

<!DOCTYPE html>


<html lang="zh-CN" >

  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

    <title>WindowBot &#8212; Aibote  文档</title>
  
  
  
  <script data-cfasync="false">
    document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
    document.documentElement.dataset.theme = localStorage.getItem("theme") || "light";
  </script>
  
  <!-- Loaded before other Sphinx assets -->
  <link href="../../_static/styles/theme.css?digest=12da95d707ffb74b382d" rel="stylesheet" />
<link href="../../_static/styles/bootstrap.css?digest=12da95d707ffb74b382d" rel="stylesheet" />
<link href="../../_static/styles/pydata-sphinx-theme.css?digest=12da95d707ffb74b382d" rel="stylesheet" />

  
  <link href="../../_static/vendor/fontawesome/6.1.2/css/all.min.css?digest=12da95d707ffb74b382d" rel="stylesheet" />
  <link rel="preload" as="font" type="font/woff2" crossorigin href="../../_static/vendor/fontawesome/6.1.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../_static/vendor/fontawesome/6.1.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../../_static/vendor/fontawesome/6.1.2/webfonts/fa-regular-400.woff2" />

    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/copybutton.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/togglebutton.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/tabs.css" />
  
  <!-- Pre-loaded scripts that we'll load fully later -->
  <link rel="preload" as="script" href="../../_static/scripts/bootstrap.js?digest=12da95d707ffb74b382d" />
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=12da95d707ffb74b382d" />

    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../_static/sphinx_highlight.js"></script>
    <script src="../../_static/clipboard.min.js"></script>
    <script src="../../_static/copybutton.js"></script>
    <script src="../../_static/tabs.js"></script>
    <script>let toggleHintShow = 'Click to show';</script>
    <script>let toggleHintHide = 'Click to hide';</script>
    <script>let toggleOpenOnPrint = 'true';</script>
    <script src="../../_static/togglebutton.js"></script>
    <script src="../../_static/translations.js"></script>
    <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
    <script>DOCUMENTATION_OPTIONS.pagename = 'dev_manual/window_bot/index';</script>
    <link rel="index" title="索引" href="../../genindex.html" />
    <link rel="search" title="搜索" href="../../search.html" />
    <link rel="next" title="界面开发" href="../ui/index.html" />
    <link rel="prev" title="WebBot" href="../web_bot/index.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta name="docsearch:language" content="zh-CN"/>
  </head>
  
  
  <body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">

  
  
  <a class="skip-link" href="#main-content">Skip to main content</a>
  
  <input type="checkbox"
          class="sidebar-toggle"
          name="__primary"
          id="__primary"/>
  <label class="overlay overlay-primary" for="__primary"></label>
  
  <input type="checkbox"
          class="sidebar-toggle"
          name="__secondary"
          id="__secondary"/>
  <label class="overlay overlay-secondary" for="__secondary"></label>
  
  <div class="search-button__wrapper">
    <div class="search-button__overlay"></div>
    <div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
      action="../../search.html"
      method="get">
  <i class="fa-solid fa-magnifying-glass"></i>
  <input type="search"
         class="form-control"
         name="q"
         id="search-input"
         placeholder="Search the docs ..."
         aria-label="Search the docs ..."
         autocomplete="off"
         autocorrect="off"
         autocapitalize="off"
         spellcheck="false"/>
  <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
  </div>
  
    <nav class="bd-header navbar navbar-expand-lg bd-navbar">
<div class="bd-header__inner bd-page-width">
  <label class="sidebar-toggle primary-toggle" for="__primary">
    <span class="fa-solid fa-bars"></span>
  </label>
  
  <div class="navbar-header-items__start">
    
      <div class="navbar-item">
  

<a class="navbar-brand logo" href="../../index.html">
  
  
  
  
  
    <p class="title logo__title">Aibote  文档</p>
  
</a></div>
    
  </div>
  
  
  <div class="col-lg-9 navbar-header-items">
    
    <div class="me-auto navbar-header-items__center">
      
        <div class="navbar-item"><nav class="navbar-nav">
  <p class="sidebar-header-items__title"
     role="heading"
     aria-level="1"
     aria-label="Site Navigation">
    Site Navigation
  </p>
  <ul class="bd-navbar-elements navbar-nav">
    
                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../user_guide/index.html">
                        Aibote 基本使用
                      </a>
                    </li>
                

                    <li class="nav-item current active">
                      <a class="nav-link nav-internal" href="../index.html">
                        Aibote 开发手册
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../reference/index.html">
                        API 参考
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../api_protocol/aiboteProtocol.html">
                        API 开源协议
                      </a>
                    </li>
                
  </ul>
</nav></div>
      
    </div>
    
    
    <div class="navbar-header-items__end">
      
        <div class="navbar-item navbar-persistent--container">
          
<script>
document.write(`
  <button class="btn btn-sm navbar-btn search-button search-button__button" title="搜索" aria-label="搜索" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="fa-solid fa-magnifying-glass"></i>
  </button>
`);
</script>
        </div>
      
      
        <div class="navbar-item">
<script>
document.write(`
  <button class="theme-switch-button btn btn-sm btn-outline-primary navbar-btn rounded-circle" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <span class="theme-switch" data-mode="light"><i class="fa-solid fa-sun"></i></span>
    <span class="theme-switch" data-mode="dark"><i class="fa-solid fa-moon"></i></span>
    <span class="theme-switch" data-mode="auto"><i class="fa-solid fa-circle-half-stroke"></i></span>
  </button>
`);
</script></div>
      
    </div>
    
  </div>
  
  
    <div class="navbar-persistent--mobile">
<script>
document.write(`
  <button class="btn btn-sm navbar-btn search-button search-button__button" title="搜索" aria-label="搜索" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="fa-solid fa-magnifying-glass"></i>
  </button>
`);
</script>
    </div>
  

  
    <label class="sidebar-toggle secondary-toggle" for="__secondary">
      <span class="fa-solid fa-outdent"></span>
    </label>
  
</div>

    </nav>
  
  <div class="bd-container">
    <div class="bd-container__inner bd-page-width">
      
      <div class="bd-sidebar-primary bd-sidebar">
        

  
  <div class="sidebar-header-items sidebar-primary__section">
    
    
      <div class="sidebar-header-items__center">
        
          <div class="navbar-item"><nav class="navbar-nav">
  <p class="sidebar-header-items__title"
     role="heading"
     aria-level="1"
     aria-label="Site Navigation">
    Site Navigation
  </p>
  <ul class="bd-navbar-elements navbar-nav">
    
                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../user_guide/index.html">
                        Aibote 基本使用
                      </a>
                    </li>
                

                    <li class="nav-item current active">
                      <a class="nav-link nav-internal" href="../index.html">
                        Aibote 开发手册
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../reference/index.html">
                        API 参考
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../../api_protocol/aiboteProtocol.html">
                        API 开源协议
                      </a>
                    </li>
                
  </ul>
</nav></div>
        
      </div>
    
    
    
      <div class="sidebar-header-items__end">
        
          <div class="navbar-item">
<script>
document.write(`
  <button class="theme-switch-button btn btn-sm btn-outline-primary navbar-btn rounded-circle" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <span class="theme-switch" data-mode="light"><i class="fa-solid fa-sun"></i></span>
    <span class="theme-switch" data-mode="dark"><i class="fa-solid fa-moon"></i></span>
    <span class="theme-switch" data-mode="auto"><i class="fa-solid fa-circle-half-stroke"></i></span>
  </button>
`);
</script></div>
        
      </div>
    
  </div>
  
    <div class="sidebar-primary-items__start sidebar-primary__section">
        <div class="sidebar-primary-item"><nav class="bd-docs-nav bd-links"
     aria-label="Section Navigation">
  <p class="bd-links__title" role="heading" aria-level="1">Section Navigation</p>
  <div class="bd-toc-item navbar-nav"><ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../android_bot/index.html">AndroidBot</a></li>
<li class="toctree-l1"><a class="reference internal" href="../web_bot/index.html">WebBot</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">WindowBot</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ui/index.html">界面开发</a></li>
<li class="toctree-l1"><a class="reference internal" href="../web_socket_bot/index.html">WebSocketBot</a></li>
<li class="toctree-l1"><a class="reference internal" href="../multimodule_mixing/index.html">多模块混合开发</a></li>
</ul>
</div>
</nav></div>
    </div>
  
  
  <div class="sidebar-primary-items__end sidebar-primary__section">
  </div>
  
  <div id="rtd-footer-container"></div>


      </div>
      
      <main id="main-content" class="bd-main">
        
        
          <div class="bd-content">
            <div class="bd-article-container">
              
              <div class="bd-header-article">
<div class="header-article-items header-article__inner">
  
    <div class="header-article-items__start">
      
        <div class="header-article-item">



<nav aria-label="Breadcrumbs">
  <ul class="bd-breadcrumbs" role="navigation" aria-label="Breadcrumb">
    
    <li class="breadcrumb-item breadcrumb-home">
      <a href="../../index.html" class="nav-link" aria-label="Home">
        <i class="fa-solid fa-home"></i>
      </a>
    </li>
    
    <li class="breadcrumb-item"><a href="../index.html" class="nav-link">Aibote 开发手册</a></li>
    
    <li class="breadcrumb-item active" aria-current="page">WindowBot</li>
  </ul>
</nav>
</div>
      
    </div>
  
  
</div>
</div>
              
              
              
                
<div id="searchbox"></div>
                <article class="bd-article" role="main">
                  
  <section id="windowbot">
<h1>WindowBot<a class="headerlink" href="#windowbot" title="此标题的永久链接">#</a></h1>
<section id="id1">
<h2>主函数示例<a class="headerlink" href="#id1" title="此标题的永久链接">#</a></h2>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-0-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-0-0-0" name="0-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-0-0-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-0-0-1" name="0-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-0-0-0" class="sphinx-tabs-panel" id="panel-0-0-0" name="0-0" role="tabpanel" tabindex="0"><div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="kd">const</span><span class="w"> </span><span class="nx">WindowsBot</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">require</span><span class="p">(</span><span class="s1">&#39;WindowsBot&#39;</span><span class="p">);</span><span class="c1">//引用WindowsBot模块</span><span class="w"></span>

<span class="c1">//注册主函数</span><span class="w"></span>
<span class="nx">WindowsBot</span><span class="p">.</span><span class="nx">registerMain</span><span class="p">(</span><span class="nx">windowsMain</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;127.0.0.1&quot;</span><span class="p">,</span><span class="w"> </span><span class="mf">26678</span><span class="p">);</span><span class="w"></span>
<span class="c1">//参数一 回调函数，要注册的函数，必须含一个参数，用作接收WindowsBot对象</span><span class="w"></span>
<span class="c1">//参数二 字符串型， 脚本所在的地址，传递给WindowsDriver.exe。如果值为 &quot;127.0.0.1&quot;脚本会将参数 ip和port作为启动参数并启动WindowsDriver.exe，否则用户需要手动启动WindowsDriver.exe 并且提供启动参数。</span><span class="w"></span>
<span class="c1">//命令行启动示例：WindowsDriver.exe &quot;192.168.1.88&quot; 26678</span><span class="w"></span>
<span class="c1">//脚本多进程需要指定不同的端口！</span><span class="w"></span>
<span class="c1">//参数三 整型，监听端口, WindowsDriver.exe。默认26678。WindowsDriver.exe会通过ip和port 连接脚本</span><span class="w"></span>

<span class="cm">/**用作代码提示，windowsMain函数会被多次调用，注意使用全局变量</span>
<span class="cm"> * @param {WindowsBot} windowsBot</span>
<span class="cm"> */</span><span class="w"></span>
<span class="k">async</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="nx">windowsMain</span><span class="p">(</span><span class="nx">windowsBot</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">//设置隐式等待</span><span class="w"></span>
<span class="w">    </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">setImplicitTimeout</span><span class="p">(</span><span class="mf">5000</span><span class="p">);</span><span class="w"></span>

<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="nx">hwnd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">findWindow</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;运行&quot;</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">clickElement</span><span class="p">(</span><span class="nx">hwnd</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;Window/Button[2]&quot;</span><span class="p">,</span><span class="w"> </span><span class="mf">1</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>


<span class="c1">// 代码示例</span><span class="w"></span>
<span class="c1">// 远程云端部署</span><span class="w"></span>
<span class="nx">WindowsBot</span><span class="p">.</span><span class="nx">registerMain</span><span class="p">(</span><span class="nx">windowsMain</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;192.168.1.88&quot;</span><span class="p">,</span><span class="w"> </span><span class="mf">26678</span><span class="p">);</span><span class="w"></span>
</pre></div>
</div>
</div><div aria-labelledby="tab-0-0-1" class="sphinx-tabs-panel" hidden="true" id="panel-0-0-1" name="0-1" role="tabpanel" tabindex="0"><div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># 1. 导入 WinBotMain 类</span>
<span class="kn">from</span> <span class="nn">AiBot</span> <span class="kn">import</span> <span class="n">WinBotMain</span>


<span class="c1"># 2. 自定义一个脚本类，继承 WinBotMain</span>
<span class="k">class</span> <span class="nc">CustomWinScript</span><span class="p">(</span><span class="n">WinBotMain</span><span class="p">):</span>
    <span class="c1"># 3. 设置等待参数</span>
    <span class="c1"># 3.1 设置等待时间</span>
    <span class="n">wait_timeout</span> <span class="o">=</span> <span class="mi">3</span>
    <span class="c1"># 3.2 设置重试间隔时长</span>
    <span class="n">interval_timeout</span> <span class="o">=</span> <span class="mf">0.5</span>

    <span class="c1"># 4. 设置日志等级</span>
    <span class="n">log_level</span> <span class="o">=</span> <span class="s2">&quot;INFO&quot;</span>  <span class="c1"># &quot;DEBUG&quot;</span>

    <span class="c1"># 5. 设置方法超时是否抛出异常</span>
    <span class="n">raise_err</span> <span class="o">=</span> <span class="kc">False</span>  <span class="c1"># True</span>

    <span class="c1"># 6. 重写方法，编写脚本</span>
    <span class="c1"># 注意：此方法是脚本执行入口</span>
    <span class="k">def</span> <span class="nf">script_main</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="c1"># 6.1 API 演示</span>
        <span class="c1"># 注意：Python 版本支持的 Api 与 Nodejs 基本相同</span>
        <span class="c1"># 教程中仅演示部分 Api，更多 Api 请自行探索，所有 Api 均包含详细的参数要求和返回值，请自行查看。</span>

        <span class="c1"># 查询所有窗口句柄</span>
        <span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">find_windows</span><span class="p">()</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>  <span class="c1"># [&quot;1050010&quot;, &quot;1050011&quot;, &quot;1050012&quot;]</span>

        <span class="c1"># 查询指定窗口句柄</span>
        <span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">find_window</span><span class="p">(</span><span class="n">window_name</span><span class="o">=</span><span class="s2">&quot;Ai-Bot 2群等9个会话&quot;</span><span class="p">)</span>
        <span class="nb">print</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>  <span class="c1"># &quot;1050010&quot;</span>


<span class="c1"># 7. 执行脚本，Pycharm 中，直接右键执行</span>
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
    <span class="c1"># 启动脚本，监听 6666 号端口</span>

    <span class="c1"># local=True 时，是本地运行脚本，会自动启动 WindowsDriver.exe 驱动；</span>
    <span class="c1"># 在远端部署脚本时，请设置 local=False，手动启动 WindowsDriver.exe，启动 WindowsDriver.exe 时需指定远端 IP 或端口号；</span>

    <span class="n">CustomWinScript</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="mi">6666</span><span class="p">,</span> <span class="n">local</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</pre></div>
</div>
</div></div>
</section>
<section id="id2">
<h2>等待超时<a class="headerlink" href="#id2" title="此标题的永久链接">#</a></h2>
<section id="sleep">
<h3>显式等待 <code class="docutils literal notranslate"><span class="pre">sleep()</span></code><a class="headerlink" href="#sleep" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-1-1-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-1-1-0" name="1-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-1-1-0" class="sphinx-tabs-panel" id="panel-1-1-0" name="1-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.sleep">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">sleep</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">millisecond</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.sleep" title="永久链接至目标">#</a></dt>
<dd><p>睡眠等待</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>millisecond</strong> (<em>number</em>) – 等待时间,单位毫秒</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;void&gt;</strong> –</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="setimplicittimeout">
<h3>隐式等待 <code class="docutils literal notranslate"><span class="pre">setImplicitTimeout()</span></code><a class="headerlink" href="#setimplicittimeout" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-2-2-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-2-2-0" name="2-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-2-2-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-2-2-1" name="2-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-2-2-0" class="sphinx-tabs-panel" id="panel-2-2-0" name="2-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.setImplicitTimeout">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setImplicitTimeout</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">waitMs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">intervalMs=10</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.setImplicitTimeout" title="永久链接至目标">#</a></dt>
<dd><p>设置隐式等待</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>waitMs</strong> (<em>number</em>) – 等待时间,单位毫秒</p></li>
<li><p><strong>intervalMs</strong> (<em>number</em>) – 心跳间隔，单位毫秒。可选参数，默认10毫秒</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;void&gt;</strong> –</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-2-2-1" class="sphinx-tabs-panel" hidden="true" id="panel-2-2-1" name="2-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.todo">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#AiBot.WinBotMain.todo" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
</section>
<section id="id3">
<h2>查找句柄<a class="headerlink" href="#id3" title="此标题的永久链接">#</a></h2>
<section id="findwindow">
<h3>查找窗口句柄 <code class="docutils literal notranslate"><span class="pre">findWindow()</span></code><a class="headerlink" href="#findwindow" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-3-3-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-3-3-0" name="3-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-3-3-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-3-3-1" name="3-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-3-3-0" class="sphinx-tabs-panel" id="panel-3-3-0" name="3-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.findWindow">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">findWindow</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">className</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">windowNmae</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.findWindow" title="永久链接至目标">#</a></dt>
<dd><p>查找窗口句柄</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>className</strong> (<em>string</em>) – 窗口类名</p></li>
<li><p><strong>windowNmae</strong> (<em>string</em>) – 窗口名</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回窗口句柄，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-3-3-1" class="sphinx-tabs-panel" hidden="true" id="panel-3-3-1" name="3-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.find_window">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">find_window</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">class_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">window_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.find_window" title="永久链接至目标">#</a></dt>
<dd><p>查找窗口句柄，仅查找顶级窗口，不包含子窗口</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>class_name</strong> – 窗口类名</p></li>
<li><p><strong>window_name</strong> – 窗口名</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="findwindows">
<h3>查找窗口句柄数组 <code class="docutils literal notranslate"><span class="pre">findWindows()</span></code><a class="headerlink" href="#findwindows" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-4-4-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-4-4-0" name="4-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-4-4-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-4-4-1" name="4-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-4-4-0" class="sphinx-tabs-panel" id="panel-4-4-0" name="4-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.findWindows">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">findWindows</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">className</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">windowNmae</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.findWindows" title="永久链接至目标">#</a></dt>
<dd><p>查找窗口句柄数组</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>className</strong> (<em>string</em>) – 窗口类名</p></li>
<li><p><strong>windowNmae</strong> (<em>string</em>) – 窗口名</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-4-4-1" class="sphinx-tabs-panel" hidden="true" id="panel-4-4-1" name="4-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.find_windows">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">find_windows</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">class_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">window_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.find_windows" title="永久链接至目标">#</a></dt>
<dd><p>查找窗口句柄数组，仅查找顶级窗口，不包含子窗口</p>
<p>class_name 和 window_name 都为 None，则返回所有窗口句柄</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>class_name</strong> – 窗口类名</p></li>
<li><p><strong>window_name</strong> – 窗口名</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>窗口句柄的列表</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="findsubwindow">
<h3>查找子窗口句柄 <code class="docutils literal notranslate"><span class="pre">findSubWindow()</span></code><a class="headerlink" href="#findsubwindow" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-5-5-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-5-5-0" name="5-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-5-5-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-5-5-1" name="5-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-5-5-0" class="sphinx-tabs-panel" id="panel-5-5-0" name="5-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.findSubWindow">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">findSubWindow</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">curHwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">className</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">windowNmae</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.findSubWindow" title="永久链接至目标">#</a></dt>
<dd><p>查找子窗口句柄</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>curHwnd</strong> (<em>string|number</em>) – 当前窗口句柄</p></li>
<li><p><strong>className</strong> (<em>string</em>) – 窗口类名</p></li>
<li><p><strong>windowNmae</strong> (<em>string</em>) – 窗口名</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回窗口句柄，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-5-5-1" class="sphinx-tabs-panel" hidden="true" id="panel-5-5-1" name="5-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.find_sub_window">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">find_sub_window</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">class_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">window_name</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.find_sub_window" title="永久链接至目标">#</a></dt>
<dd><p>查找子窗口句柄</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 当前窗口句柄</p></li>
<li><p><strong>class_name</strong> – 窗口类名</p></li>
<li><p><strong>window_name</strong> – 窗口名</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>子窗口句柄或 None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="findparentwindow">
<h3>查找父窗口句柄 <code class="docutils literal notranslate"><span class="pre">findParentWindow()</span></code><a class="headerlink" href="#findparentwindow" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-6-6-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-6-6-0" name="6-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-6-6-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-6-6-1" name="6-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-6-6-0" class="sphinx-tabs-panel" id="panel-6-6-0" name="6-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.findParentWindow">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">findParentWindow</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">curHwnd</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.findParentWindow" title="永久链接至目标">#</a></dt>
<dd><p>查找父窗口句柄</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>curHwnd</strong> (<em>string|number</em>) – 当前窗口句柄</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回窗口句柄，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-6-6-1" class="sphinx-tabs-panel" hidden="true" id="panel-6-6-1" name="6-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.find_parent_window">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">find_parent_window</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.find_parent_window" title="永久链接至目标">#</a></dt>
<dd><p>查找父窗口句柄</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>hwnd</strong> – 当前窗口句柄</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>父窗口句柄或 None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="finddesktopwindow">
<h3>查找桌面窗口句柄 <code class="docutils literal notranslate"><span class="pre">findDesktopWindow()</span></code><a class="headerlink" href="#finddesktopwindow" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-7-7-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-7-7-0" name="7-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-7-7-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-7-7-1" name="7-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-7-7-0" class="sphinx-tabs-panel" id="panel-7-7-0" name="7-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.findDesktopWindow">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">findDesktopWindow</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.findDesktopWindow" title="永久链接至目标">#</a></dt>
<dd><p>查找桌面窗口句柄</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回窗口句柄，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-7-7-1" class="sphinx-tabs-panel" hidden="true" id="panel-7-7-1" name="7-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id0">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id0" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
</section>
<section id="id4">
<h2>获取窗口名称<a class="headerlink" href="#id4" title="此标题的永久链接">#</a></h2>
<section id="getwindowname">
<h3>获取窗口名称 <code class="docutils literal notranslate"><span class="pre">getWindowName()</span></code><a class="headerlink" href="#getwindowname" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-8-8-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-8-8-0" name="8-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-8-8-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-8-8-1" name="8-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-8-8-0" class="sphinx-tabs-panel" id="panel-8-8-0" name="8-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getWindowName">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getWindowName</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getWindowName" title="永久链接至目标">#</a></dt>
<dd><p>获取窗口名称</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回窗口名称，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-8-8-1" class="sphinx-tabs-panel" hidden="true" id="panel-8-8-1" name="8-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.get_window_name">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">get_window_name</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.get_window_name" title="永久链接至目标">#</a></dt>
<dd><p>获取窗口名称</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>hwnd</strong> – 当前窗口句柄</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>窗口名称或 None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id5">
<h2>窗口操作<a class="headerlink" href="#id5" title="此标题的永久链接">#</a></h2>
<section id="showwindow">
<h3>显示/隐藏窗口 <code class="docutils literal notranslate"><span class="pre">showWindow()</span></code><a class="headerlink" href="#showwindow" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-9-9-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-9-9-0" name="9-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-9-9-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-9-9-1" name="9-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-9-9-0" class="sphinx-tabs-panel" id="panel-9-9-0" name="9-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.showWindow">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">showWindow</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">isShow</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.showWindow" title="永久链接至目标">#</a></dt>
<dd><p>显示/隐藏窗口</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>isShow</strong> (<em>boolean</em>) – 显示窗口 true， 隐藏窗口 false</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-9-9-1" class="sphinx-tabs-panel" hidden="true" id="panel-9-9-1" name="9-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.show_window">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">show_window</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.show_window" title="永久链接至目标">#</a></dt>
<dd><p>显示/隐藏窗口</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 当前窗口句柄</p></li>
<li><p><strong>show</strong> – 是否显示窗口</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="setwindowtop">
<h3>设置窗口到最顶层 <code class="docutils literal notranslate"><span class="pre">setWindowTop()</span></code><a class="headerlink" href="#setwindowtop" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-10-10-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-10-10-0" name="10-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-10-10-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-10-10-1" name="10-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-10-10-0" class="sphinx-tabs-panel" id="panel-10-10-0" name="10-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.setWindowTop">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setWindowTop</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">isTop</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.setWindowTop" title="永久链接至目标">#</a></dt>
<dd><p>设置窗口到最顶层</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>isTop</strong> (<em>boolean</em>) – 是否置顶，true置顶， false取消置顶</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-10-10-1" class="sphinx-tabs-panel" hidden="true" id="panel-10-10-1" name="10-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.set_window_top">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">set_window_top</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">top</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.set_window_top" title="永久链接至目标">#</a></dt>
<dd><p>设置窗口到最顶层</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 当前窗口句柄</p></li>
<li><p><strong>top</strong> – 是否置顶，True 置顶， False 取消置顶</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="getwindowpos">
<h3>获取窗口位置 <code class="docutils literal notranslate"><span class="pre">getWindowPos()</span></code><a class="headerlink" href="#getwindowpos" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-11-11-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-11-11-0" name="11-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-11-11-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-11-11-1" name="11-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-11-11-0" class="sphinx-tabs-panel" id="panel-11-11-0" name="11-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getWindowPos">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getWindowPos</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getWindowPos" title="永久链接至目标">#</a></dt>
<dd><p>获取窗口位置</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;{left:number, top:number, width:number, height:number}&gt;</strong> – 成功返回窗口位置，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-11-11-1" class="sphinx-tabs-panel" hidden="true" id="panel-11-11-1" name="11-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id6">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id6" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
<section id="setwindowpos">
<h3>设置窗口位置 <code class="docutils literal notranslate"><span class="pre">setWindowPos()</span></code><a class="headerlink" href="#setwindowpos" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-12-12-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-12-12-0" name="12-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-12-12-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-12-12-1" name="12-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-12-12-0" class="sphinx-tabs-panel" id="panel-12-12-0" name="12-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.setWindowPos">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setWindowPos</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">left</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">top</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">width</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">height</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.setWindowPos" title="永久链接至目标">#</a></dt>
<dd><p>设置窗口位置</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>left</strong> (<em>number</em>) – 左上角横坐标</p></li>
<li><p><strong>top</strong> (<em>number</em>) – 左上角纵坐标</p></li>
<li><p><strong>width</strong> (<em>number</em>) – 窗口宽度</p></li>
<li><p><strong>height</strong> (<em>number</em>) – 窗口高度</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-12-12-1" class="sphinx-tabs-panel" hidden="true" id="panel-12-12-1" name="12-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id7">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id7" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
</section>
<section id="id8">
<h2>鼠标键盘<a class="headerlink" href="#id8" title="此标题的永久链接">#</a></h2>
<section id="movemouse">
<h3>移动鼠标 <code class="docutils literal notranslate"><span class="pre">moveMouse()</span></code><a class="headerlink" href="#movemouse" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-13-13-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-13-13-0" name="13-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-13-13-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-13-13-1" name="13-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-13-13-0" class="sphinx-tabs-panel" id="panel-13-13-0" name="13-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.moveMouse">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">moveMouse</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.moveMouse" title="永久链接至目标">#</a></dt>
<dd><p>移动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>x</strong> (<em>number</em>) – 横坐标</p></li>
<li><p><strong>y</strong> (<em>number</em>) – 纵坐标</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-13-13-1" class="sphinx-tabs-panel" hidden="true" id="panel-13-13-1" name="13-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.move_mouse">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">move_mouse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ele_hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'0'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.move_mouse" title="永久链接至目标">#</a></dt>
<dd><p>移动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 当前窗口句柄</p></li>
<li><p><strong>x</strong> – 横坐标</p></li>
<li><p><strong>y</strong> – 纵坐标</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作</p></li>
<li><p><strong>ele_hwnd</strong> – 元素句柄，如果 mode=True 且目标控件有单独的句柄，则需要通过 get_element_window 获得元素句柄，指定 ele_hwnd 的值(极少应用窗口由父窗口响应消息，则无需指定);</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="movemouserelative">
<h3>移动鼠标(相对坐标) <code class="docutils literal notranslate"><span class="pre">moveMouseRelative()</span></code><a class="headerlink" href="#movemouserelative" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-14-14-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-14-14-0" name="14-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-14-14-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-14-14-1" name="14-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-14-14-0" class="sphinx-tabs-panel" id="panel-14-14-0" name="14-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.moveMouseRelative">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">moveMouseRelative</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode=false</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.moveMouseRelative" title="永久链接至目标">#</a></dt>
<dd><p>移动鼠标(相对坐标)</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>x</strong> (<em>number</em>) – 相对横坐标</p></li>
<li><p><strong>y</strong> (<em>number</em>) – 相对纵坐标</p></li>
<li><p><strong>mode</strong> (<em>boolean</em>) – 操作模式，后台 true，前台 false。默认前台操作</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-14-14-1" class="sphinx-tabs-panel" hidden="true" id="panel-14-14-1" name="14-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id9">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id9" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
<section id="rollmouse">
<h3>滚动鼠标 <code class="docutils literal notranslate"><span class="pre">rollMouse()</span></code><a class="headerlink" href="#rollmouse" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-15-15-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-15-15-0" name="15-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-15-15-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-15-15-1" name="15-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-15-15-0" class="sphinx-tabs-panel" id="panel-15-15-0" name="15-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.rollMouse">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">rollMouse</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dwData</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode=false</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.rollMouse" title="永久链接至目标">#</a></dt>
<dd><p>滚动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>x</strong> (<em>number</em>) – 横坐标</p></li>
<li><p><strong>y</strong> (<em>number</em>) – 纵坐标</p></li>
<li><p><strong>dwData</strong> (<em>number</em>) – 鼠标滚动次数,负数下滚鼠标,正数上滚鼠标</p></li>
<li><p><strong>mode</strong> (<em>boolean</em>) – 操作模式，后台 true，前台 false。默认前台操作</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-15-15-1" class="sphinx-tabs-panel" hidden="true" id="panel-15-15-1" name="15-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.scroll_mouse">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">scroll_mouse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.scroll_mouse" title="永久链接至目标">#</a></dt>
<dd><p>滚动鼠标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 当前窗口句柄</p></li>
<li><p><strong>x</strong> – 横坐标</p></li>
<li><p><strong>y</strong> – 纵坐标</p></li>
<li><p><strong>count</strong> – 鼠标滚动次数, 负数下滚鼠标, 正数上滚鼠标</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="clickmouse">
<h3>鼠标点击 <code class="docutils literal notranslate"><span class="pre">clickMouse()</span></code><a class="headerlink" href="#clickmouse" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-16-16-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-16-16-0" name="16-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-16-16-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-16-16-1" name="16-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-16-16-0" class="sphinx-tabs-panel" id="panel-16-16-0" name="16-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.clickMouse">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clickMouse</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.clickMouse" title="永久链接至目标">#</a></dt>
<dd><p>鼠标点击</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>x</strong> (<em>number</em>) – 横坐标</p></li>
<li><p><strong>y</strong> (<em>number</em>) – 纵坐标</p></li>
<li><p><strong>msg</strong> (<em>number</em>) – 单击左键:1 单击右键:2 按下左键:3 弹起左键:4 按下右键:5 弹起右键:6 双击左键:7 双击右键:8</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true。</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-16-16-1" class="sphinx-tabs-panel" hidden="true" id="panel-16-16-1" name="16-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.click_mouse">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">click_mouse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">typ</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ele_hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'0'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.click_mouse" title="永久链接至目标">#</a></dt>
<dd><p>鼠标点击</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 当前窗口句柄</p></li>
<li><p><strong>x</strong> – 横坐标</p></li>
<li><p><strong>y</strong> – 纵坐标</p></li>
<li><p><strong>typ</strong> – 点击类型，单击左键:1 单击右键:2 按下左键:3 弹起左键:4 按下右键:5 弹起右键:6 双击左键:7 双击右键:8</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作</p></li>
<li><p><strong>ele_hwnd</strong> – 元素句柄，如果 mode=True 且目标控件有单独的句柄，则需要通过 get_element_window 获得元素句柄，指定 ele_hwnd 的值(极少应用窗口由父窗口响应消息，则无需指定);</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="sendkeys">
<h3>输入文本 <code class="docutils literal notranslate"><span class="pre">sendKeys()</span></code><a class="headerlink" href="#sendkeys" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-17-17-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-17-17-0" name="17-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-17-17-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-17-17-1" name="17-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-17-17-0" class="sphinx-tabs-panel" id="panel-17-17-0" name="17-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.sendKeys">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">sendKeys</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.sendKeys" title="永久链接至目标">#</a></dt>
<dd><p>输入文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<em>string</em>) – 输入的文本</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-17-17-1" class="sphinx-tabs-panel" hidden="true" id="panel-17-17-1" name="17-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.send_keys">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">send_keys</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.send_keys" title="永久链接至目标">#</a></dt>
<dd><p>输入文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>text</strong> – 输入的文本</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="sendkeysbyhwnd">
<h3>后台输入文本 <code class="docutils literal notranslate"><span class="pre">sendKeysByHwnd()</span></code><a class="headerlink" href="#sendkeysbyhwnd" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-18-18-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-18-18-0" name="18-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-18-18-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-18-18-1" name="18-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-18-18-0" class="sphinx-tabs-panel" id="panel-18-18-0" name="18-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.sendKeysByHwnd">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">sendKeysByHwnd</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">text</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.sendKeysByHwnd" title="永久链接至目标">#</a></dt>
<dd><p>后台输入文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄，如果目标控件有单独的句柄，需要通过getElementWindow获得句柄</p></li>
<li><p><strong>text</strong> (<em>string</em>) – 输入的文本</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-18-18-1" class="sphinx-tabs-panel" hidden="true" id="panel-18-18-1" name="18-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.send_keys_by_hwnd">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">send_keys_by_hwnd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">text</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.send_keys_by_hwnd" title="永久链接至目标">#</a></dt>
<dd><p>后台输入文本(杀毒软件可能会拦截)</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>text</strong> – 输入的文本</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="vk-sendvk">
<h3>输入虚拟键值(VK) <code class="docutils literal notranslate"><span class="pre">sendVk()</span></code><a class="headerlink" href="#vk-sendvk" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-19-19-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-19-19-0" name="19-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-19-19-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-19-19-1" name="19-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-19-19-0" class="sphinx-tabs-panel" id="panel-19-19-0" name="19-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.sendVk">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">sendVk</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bVk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.sendVk" title="永久链接至目标">#</a></dt>
<dd><p>输入虚拟键值(VK)</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>bVk</strong> (<em>number</em>) – VK键值，例如：回车对应 VK键值 13</p></li>
<li><p><strong>msg</strong> (<em>number</em>) – 按下弹起:1 按下:2 弹起:3</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-19-19-1" class="sphinx-tabs-panel" hidden="true" id="panel-19-19-1" name="19-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.send_vk">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">send_vk</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vk</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">typ</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.send_vk" title="永久链接至目标">#</a></dt>
<dd><p>输入虚拟键值(VK)</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>vk</strong> – VK键值</p></li>
<li><p><strong>typ</strong> – 输入类型，按下弹起:1 按下:2 弹起:3</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="vk-sendvkbyhwnd">
<h3>后台输入虚拟键值(VK) <code class="docutils literal notranslate"><span class="pre">sendVkByHwnd()</span></code><a class="headerlink" href="#vk-sendvkbyhwnd" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-20-20-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-20-20-0" name="20-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-20-20-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-20-20-1" name="20-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-20-20-0" class="sphinx-tabs-panel" id="panel-20-20-0" name="20-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.sendVkByHwnd">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">sendVkByHwnd</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bVk</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.sendVkByHwnd" title="永久链接至目标">#</a></dt>
<dd><p>后台输入虚拟键值(VK)</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄，如果目标控件有单独的句柄，需要通过getElementWindow获得句柄</p></li>
<li><p><strong>bVk</strong> (<em>number</em>) – VK键值，例如：回车对应 VK键值 13</p></li>
<li><p><strong>msg</strong> (<em>number</em>) – 按下弹起:1 按下:2 弹起:3</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true。若是后台组合键，可使用sendVk 按下控制键(AltShiftCtrl…)，再组合其他按键</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-20-20-1" class="sphinx-tabs-panel" hidden="true" id="panel-20-20-1" name="20-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.send_vk_by_hwnd">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">send_vk_by_hwnd</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vk</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">typ</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.send_vk_by_hwnd" title="永久链接至目标">#</a></dt>
<dd><p>后台输入虚拟键值(VK)</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>vk</strong> – VK键值</p></li>
<li><p><strong>typ</strong> – 输入类型，按下弹起:1 按下:2 弹起:3</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id10">
<h2>图色操作<a class="headerlink" href="#id10" title="此标题的永久链接">#</a></h2>
<section id="savescreenshot">
<h3>截图保存 <code class="docutils literal notranslate"><span class="pre">saveScreenshot()</span></code><a class="headerlink" href="#savescreenshot" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-21-21-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-21-21-0" name="21-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-21-21-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-21-21-1" name="21-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-21-21-0" class="sphinx-tabs-panel" id="panel-21-21-0" name="21-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.saveScreenshot">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">saveScreenshot</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">savePath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.saveScreenshot" title="永久链接至目标">#</a></dt>
<dd><p>截图保存</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>savePath</strong> (<em>string</em>) – 保存的位置</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> –</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-21-21-1" class="sphinx-tabs-panel" hidden="true" id="panel-21-21-1" name="21-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.save_screenshot">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">save_screenshot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">save_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">region</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.save_screenshot" title="永久链接至目标">#</a></dt>
<dd><p>截图</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>save_path</strong> – 图片存储路径</p></li>
<li><p><strong>region</strong> – 截图区域，默认全屏，<code class="docutils literal notranslate"><span class="pre">region</span> <span class="pre">=</span> <span class="pre">(起点x、起点y、终点x、终点y)</span></code>，得到一个矩形</p></li>
<li><p><strong>algorithm</strong> – <p>处理截图所用算法和参数，默认保存原图，</p>
<p><code class="docutils literal notranslate"><span class="pre">algorithm</span> <span class="pre">=</span> <span class="pre">(algorithm_type,</span> <span class="pre">threshold,</span> <span class="pre">max_val)</span></code></p>
<p>按元素顺序分别代表：</p>
<ol class="arabic simple" start="0">
<li><p><code class="docutils literal notranslate"><span class="pre">algorithm_type</span></code> 算法类型</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">threshold</span></code> 阈值</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">max_val</span></code> 最大值</p></li>
</ol>
<p><code class="docutils literal notranslate"><span class="pre">threshold</span></code> 和 <code class="docutils literal notranslate"><span class="pre">max_val</span></code> 同为 255 时灰度处理.</p>
<p><code class="docutils literal notranslate"><span class="pre">algorithm_type</span></code> 算法类型说明:</p>
<ol class="arabic simple" start="0">
<li><p><code class="docutils literal notranslate"><span class="pre">THRESH_BINARY</span></code>      算法，当前点值大于阈值 <cite>threshold</cite> 时，取最大值 <code class="docutils literal notranslate"><span class="pre">max_val</span></code>，否则设置为 0；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">THRESH_BINARY_INV</span></code>  算法，当前点值大于阈值 <cite>threshold</cite> 时，设置为 0，否则设置为最大值 max_val；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">THRESH_TOZERO</span></code>      算法，当前点值大于阈值 <cite>threshold</cite> 时，不改变，否则设置为 0；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">THRESH_TOZERO_INV</span></code>  算法，当前点值大于阈值 <code class="docutils literal notranslate"><span class="pre">threshold</span></code> 时，设置为 0，否则不改变；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">THRESH_TRUNC</span></code>       算法，当前点值大于阈值 <code class="docutils literal notranslate"><span class="pre">threshold</span></code> 时，设置为阈值 <code class="docutils literal notranslate"><span class="pre">threshold</span></code>，否则不改变；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ADAPTIVE_THRESH_MEAN_C</span></code>      算法，自适应阈值；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ADAPTIVE_THRESH_GAUSSIAN_C</span></code>  算法，自适应阈值；</p></li>
</ol>
</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="getcolor">
<h3>获取指定坐标点的色值 <code class="docutils literal notranslate"><span class="pre">getColor()</span></code><a class="headerlink" href="#getcolor" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-22-22-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-22-22-0" name="22-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-22-22-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-22-22-1" name="22-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-22-22-0" class="sphinx-tabs-panel" id="panel-22-22-0" name="22-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getColor">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getColor</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode=false</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getColor" title="永久链接至目标">#</a></dt>
<dd><p>获取指定坐标点的色值</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>x</strong> (<em>number</em>) – 横坐标</p></li>
<li><p><strong>y</strong> (<em>number</em>) – 纵坐标</p></li>
<li><p><strong>mode</strong> (<em>boolean</em>) – 操作模式，后台 true，前台 false。默认前台操作</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回#开头的颜色值，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-22-22-1" class="sphinx-tabs-panel" hidden="true" id="panel-22-22-1" name="22-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.get_color">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">get_color</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.get_color" title="永久链接至目标">#</a></dt>
<dd><p>获取指定坐标点的色值，返回色值字符串(#008577)或者 None</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄；</p></li>
<li><p><strong>x</strong> – x 坐标；</p></li>
<li><p><strong>y</strong> – y 坐标；</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="findimage">
<h3>找图 <code class="docutils literal notranslate"><span class="pre">findImage()</span></code><a class="headerlink" href="#findimage" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-23-23-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-23-23-0" name="23-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-23-23-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-23-23-1" name="23-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-23-23-0" class="sphinx-tabs-panel" id="panel-23-23-0" name="23-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.findImage">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">findImage</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">imagePath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.findImage" title="永久链接至目标">#</a></dt>
<dd><p>找图</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>imagePath</strong> (<em>string</em>) – 小图片路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回 单坐标点[{x:number, y:number}]，多坐标点[{x1:number, y1:number}, {x2:number, y2:number}…] 失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-23-23-1" class="sphinx-tabs-panel" hidden="true" id="panel-23-23-1" name="23-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.find_images">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">find_images</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">image_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">region</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">similarity</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0.9</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">multi</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Point</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.find_images" title="永久链接至目标">#</a></dt>
<dd><p>寻找图片坐标，在当前屏幕中寻找给定图片中心点的坐标，返回坐标列表</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄；</p></li>
<li><p><strong>image_path</strong> – 图片的绝对路径；</p></li>
<li><p><strong>region</strong> – 从指定区域中找图，默认全屏；</p></li>
<li><p><strong>algorithm</strong> – 处理屏幕截图所用的算法，默认原图，注意：给定图片处理时所用的算法，应该和此方法的算法一致；</p></li>
<li><p><strong>similarity</strong> – 相似度，0-1 的浮点数，默认 0.9；</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作；</p></li>
<li><p><strong>multi</strong> – 返回图片数量，默认1张；</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference internal" href="../../reference/py/api/AiBot.WinBotMain.save_screenshot.html#AiBot.WinBotMain.save_screenshot" title="AiBot.WinBotMain.save_screenshot"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_screenshot()</span></code></a>: <code class="docutils literal notranslate"><span class="pre">region</span></code> 和 <code class="docutils literal notranslate"><span class="pre">algorithm</span></code> 的参数说明</p>
</div>
</dd></dl>

</div></div>
</section>
<section id="findanimation">
<h3>找动态图 <code class="docutils literal notranslate"><span class="pre">findAnimation()</span></code><a class="headerlink" href="#findanimation" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-24-24-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-24-24-0" name="24-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-24-24-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-24-24-1" name="24-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-24-24-0" class="sphinx-tabs-panel" id="panel-24-24-0" name="24-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.findAnimation">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">findAnimation</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frameRate</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.findAnimation" title="永久链接至目标">#</a></dt>
<dd><p>找动态图</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>frameRate</strong> (<em>number</em>) – 前后两张图相隔的时间，单位毫秒</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;number&gt;</strong> – 成功返回 单坐标点[{x:number, y:number}]，多坐标点[{x1:number, y1:number}, {x2:number, y2:number}…] 失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-24-24-1" class="sphinx-tabs-panel" hidden="true" id="panel-24-24-1" name="24-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.find_dynamic_image">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">find_dynamic_image</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_ti</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">region</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Point</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.find_dynamic_image" title="永久链接至目标">#</a></dt>
<dd><p>找动态图，对比同一张图在不同时刻是否发生变化，返回坐标列表</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄；</p></li>
<li><p><strong>interval_ti</strong> – 前后时刻的间隔时间，单位毫秒；</p></li>
<li><p><strong>region</strong> – 在指定区域找图，默认全屏；</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作；</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference internal" href="../../reference/py/api/AiBot.WinBotMain.save_screenshot.html#AiBot.WinBotMain.save_screenshot" title="AiBot.WinBotMain.save_screenshot"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_screenshot()</span></code></a>: <code class="docutils literal notranslate"><span class="pre">region</span></code> 的参数说明</p>
</div>
</dd></dl>

</div></div>
</section>
<section id="findcolor">
<h3>查找指定色值的坐标点 <code class="docutils literal notranslate"><span class="pre">findColor()</span></code><a class="headerlink" href="#findcolor" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-25-25-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-25-25-0" name="25-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-25-25-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-25-25-1" name="25-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-25-25-0" class="sphinx-tabs-panel" id="panel-25-25-0" name="25-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.findColor">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">findColor</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strMainColor</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.findColor" title="永久链接至目标">#</a></dt>
<dd><p>查找指定色值的坐标点</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>strMainColor</strong> (<em>string</em>) – #开头的色值</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;{x:number, y:number}&gt;</strong> – 成功返回{x:number, y:number} 失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-25-25-1" class="sphinx-tabs-panel" hidden="true" id="panel-25-25-1" name="25-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.find_color">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">find_color</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">color</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sub_colors</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">region</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">similarity</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0.9</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#AiBot.WinBotMain.find_color" title="永久链接至目标">#</a></dt>
<dd><p>获取指定色值的坐标点，返回坐标或者 None</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄；</p></li>
<li><p><strong>color</strong> – 颜色字符串，必须以 # 开头，例如：#008577；</p></li>
<li><p><strong>sub_colors</strong> – 辅助定位的其他颜色；</p></li>
<li><p><strong>region</strong> – 在指定区域内找色，默认全屏；</p></li>
<li><p><strong>similarity</strong> – 相似度，0-1 的浮点数，默认 0.9；</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作；</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference internal" href="../../reference/py/api/AiBot.WinBotMain.save_screenshot.html#AiBot.WinBotMain.save_screenshot" title="AiBot.WinBotMain.save_screenshot"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_screenshot()</span></code></a>: <code class="docutils literal notranslate"><span class="pre">region</span></code> 和 <code class="docutils literal notranslate"><span class="pre">algorithm</span></code> 的参数说明</p>
</div>
</dd></dl>

</div></div>
</section>
<section id="comparecolor">
<h3>比较指定坐标点的颜色值 <code class="docutils literal notranslate"><span class="pre">compareColor()</span></code><a class="headerlink" href="#comparecolor" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-26-26-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-26-26-0" name="26-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-26-26-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-26-26-1" name="26-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-26-26-0" class="sphinx-tabs-panel" id="panel-26-26-0" name="26-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.compareColor">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">compareColor</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mainX</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mainY</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strMainColor</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.compareColor" title="永久链接至目标">#</a></dt>
<dd><p>比较指定坐标点的颜色值</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>mainX</strong> (<em>number</em>) – 主颜色所在的X坐标</p></li>
<li><p><strong>mainY</strong> (<em>number</em>) – 主颜色所在的Y坐标</p></li>
<li><p><strong>strMainColor</strong> (<em>string</em>) – #开头的色值</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-26-26-1" class="sphinx-tabs-panel" hidden="true" id="panel-26-26-1" name="26-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id11">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id11" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
</section>
<section id="ocr">
<h2>OCR系统<a class="headerlink" href="#ocr" title="此标题的永久链接">#</a></h2>
<section id="findwords">
<h3>找字 <code class="docutils literal notranslate"><span class="pre">findWords()</span></code><a class="headerlink" href="#findwords" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-27-27-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-27-27-0" name="27-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-27-27-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-27-27-1" name="27-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-27-27-0" class="sphinx-tabs-panel" id="panel-27-27-0" name="27-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.findWords">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">findWords</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwndOrImagePath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">words</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.findWords" title="永久链接至目标">#</a></dt>
<dd><p>查找文字</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwndOrImagePath</strong> (<em>string|number</em>) – 窗口句柄或者图片路径</p></li>
<li><p><strong>words</strong> (<em>string</em>) – 要查找的文字</p></li>
<li><p><strong>options</strong> (<em>string</em>) – 可选参数 region 指定区域 [10, 20, 100, 200]，region默认全图 threshold二值化图片, thresholdType算法类型： 0   THRESH_BINARY算法，当前点值大于阈值thresh时，取最大值maxva，否则设置为0 1   THRESH_BINARY_INV算法，当前点值大于阈值thresh时，设置为0，否则设置为最大值maxva 2   THRESH_TOZERO算法，当前点值大于阈值thresh时，不改变，否则设置为0 3   THRESH_TOZERO_INV算法，当前点值大于阈值thresh时，设置为0，否则不改变 4   THRESH_TRUNC算法，当前点值大于阈值thresh时，设置为阈值thresh，否则不改变 5   ADAPTIVE_THRESH_MEAN_C算法，自适应阈值 6   ADAPTIVE_THRESH_GAUSSIAN_C算法，自适应阈值 thresh阈值，maxval最大值，threshold默认保存原图。thresh和maxval同为255时灰度处理 mode 操作模式，后台 true，前台 false。默认前台操作, 仅适用于hwnd</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-27-27-1" class="sphinx-tabs-panel" hidden="true" id="panel-27-27-1" name="27-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.find_text">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">find_text</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd_or_image_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">text</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">region</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Point</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.find_text" title="永久链接至目标">#</a></dt>
<dd><p>通过 OCR 识别窗口/图片中的文字，返回文字列表</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd_or_image_path</strong> – 句柄或者图片路径</p></li>
<li><p><strong>text</strong> – 要查找的文字</p></li>
<li><p><strong>region</strong> – 识别区域，默认全屏</p></li>
<li><p><strong>algorithm</strong> – 处理图片/屏幕所用算法和参数，默认保存原图</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>文字列表</p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference internal" href="../../reference/py/api/AiBot.WinBotMain.save_screenshot.html#AiBot.WinBotMain.save_screenshot" title="AiBot.WinBotMain.save_screenshot"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_screenshot()</span></code></a>: <code class="docutils literal notranslate"><span class="pre">region</span></code> 和 <code class="docutils literal notranslate"><span class="pre">algorithm</span></code> 的参数说明</p>
</div>
</dd></dl>

</div></div>
</section>
<section id="getwords">
<h3>获取屏幕文字 <code class="docutils literal notranslate"><span class="pre">getWords()</span></code><a class="headerlink" href="#getwords" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-28-28-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-28-28-0" name="28-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-28-28-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-28-28-1" name="28-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-28-28-0" class="sphinx-tabs-panel" id="panel-28-28-0" name="28-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getWords">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getWords</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwndOrImagePath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getWords" title="永久链接至目标">#</a></dt>
<dd><p>获取屏幕文字</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwndOrImagePath</strong> (<em>string|number</em>) – 窗口句柄或者图片路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 失败返回null，成功返窗口上的文字</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-28-28-1" class="sphinx-tabs-panel" hidden="true" id="panel-28-28-1" name="28-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.get_text">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">get_text</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd_or_image_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">region</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">int</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.get_text" title="永久链接至目标">#</a></dt>
<dd><p>通过 OCR 识别窗口/图片中的文字，返回文字列表</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd_or_image_path</strong> – 窗口句柄或者图片路径；</p></li>
<li><p><strong>region</strong> – 识别区域，默认全屏；</p></li>
<li><p><strong>algorithm</strong> – 处理图片/屏幕所用算法和参数，默认保存原图；</p></li>
<li><p><strong>mode</strong> – 操作模式，后台 true，前台 false, 默认前台操作；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference internal" href="../../reference/py/api/AiBot.WinBotMain.save_screenshot.html#AiBot.WinBotMain.save_screenshot" title="AiBot.WinBotMain.save_screenshot"><code class="xref py py-meth docutils literal notranslate"><span class="pre">save_screenshot()</span></code></a>: <code class="docutils literal notranslate"><span class="pre">region</span></code> 和 <code class="docutils literal notranslate"><span class="pre">algorithm</span></code> 的参数说明</p>
</div>
</dd></dl>

</div></div>
</section>
</section>
<section id="id12">
<h2>元素操作<a class="headerlink" href="#id12" title="此标题的永久链接">#</a></h2>
<section id="getelementname">
<h3>获取元素名称 <code class="docutils literal notranslate"><span class="pre">getElementName()</span></code><a class="headerlink" href="#getelementname" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-29-29-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-29-29-0" name="29-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-29-29-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-29-29-1" name="29-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-29-29-0" class="sphinx-tabs-panel" id="panel-29-29-0" name="29-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getElementName">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElementName</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getElementName" title="永久链接至目标">#</a></dt>
<dd><p>获取指定元素名称</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄。如果是java窗口并且窗口句柄和元素句柄不一致，需要使用getElementWindow获取窗口句柄。 getElementWindow参数的xpath，Aibote Tool应当使用正常模式下获取的XPATH路径，不要 “勾选java窗口” 复选按钮。对话框子窗口，需要获取对应的窗口句柄操作</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回元素名称</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-29-29-1" class="sphinx-tabs-panel" hidden="true" id="panel-29-29-1" name="29-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.get_element_name">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">get_element_name</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.get_element_name" title="永久链接至目标">#</a></dt>
<dd><p>获取元素名称</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>元素名称字符串或 None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="getelementvalue">
<h3>获取元素文本 <code class="docutils literal notranslate"><span class="pre">getElementValue()</span></code><a class="headerlink" href="#getelementvalue" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-30-30-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-30-30-0" name="30-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-30-30-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-30-30-1" name="30-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-30-30-0" class="sphinx-tabs-panel" id="panel-30-30-0" name="30-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getElementValue">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElementValue</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getElementValue" title="永久链接至目标">#</a></dt>
<dd><p>获取指定元素文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回元素文本</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-30-30-1" class="sphinx-tabs-panel" hidden="true" id="panel-30-30-1" name="30-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.get_element_value">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">get_element_value</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.get_element_value" title="永久链接至目标">#</a></dt>
<dd><p>获取元素文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>元素文本字符串或 None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="getelementrect">
<h3>获取元素矩形大小 <code class="docutils literal notranslate"><span class="pre">getElementRect()</span></code><a class="headerlink" href="#getelementrect" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-31-31-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-31-31-0" name="31-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-31-31-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-31-31-1" name="31-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-31-31-0" class="sphinx-tabs-panel" id="panel-31-31-0" name="31-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getElementRect">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElementRect</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getElementRect" title="永久链接至目标">#</a></dt>
<dd><p>获取指定元素矩形大小</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄。如果是java窗口并且窗口句柄和元素句柄不一致，需要使用getElementWindow获取窗口句柄。 getElementWindow参数的xpath，Aibote Tool应当使用正常模式下获取的XPATH路径，不要 “勾选java窗口” 复选按钮。对话框子窗口，需要获取对应的窗口句柄操作</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;{left:number, top:number, right:number, bottom:number}&gt;</strong> – 成功返回元素位置，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-31-31-1" class="sphinx-tabs-panel" hidden="true" id="panel-31-31-1" name="31-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.get_element_rect">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">get_element_rect</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">Point</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Point</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.get_element_rect" title="永久链接至目标">#</a></dt>
<dd><p>获取元素矩形，返回左上和右下坐标</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>左上和右下坐标</p>
</dd>
<dt class="field-odd">返回类型<span class="colon">:</span></dt>
<dd class="field-odd"><p>Optional[Tuple[Point, Point]]</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="getelementwindow">
<h3>获取元素窗口句柄 <code class="docutils literal notranslate"><span class="pre">getElementWindow()</span></code><a class="headerlink" href="#getelementwindow" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-32-32-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-32-32-0" name="32-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-32-32-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-32-32-1" name="32-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-32-32-0" class="sphinx-tabs-panel" id="panel-32-32-0" name="32-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getElementWindow">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getElementWindow</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getElementWindow" title="永久链接至目标">#</a></dt>
<dd><p>获取元素窗口句柄</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回元素窗口句柄，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-32-32-1" class="sphinx-tabs-panel" hidden="true" id="panel-32-32-1" name="32-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.get_element_window">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">get_element_window</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#AiBot.WinBotMain.get_element_window" title="永久链接至目标">#</a></dt>
<dd><p>获取元素窗口句柄</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p>元素窗口句柄字符串或 None</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="clickelement">
<h3>点击元素 <a href="#id13"><span class="problematic" id="id14">``</span></a>clickElement()<a class="headerlink" href="#clickelement" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-33-33-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-33-33-0" name="33-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-33-33-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-33-33-1" name="33-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-33-33-0" class="sphinx-tabs-panel" id="panel-33-33-0" name="33-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.clickElement">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">clickElement</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.clickElement" title="永久链接至目标">#</a></dt>
<dd><p>点击元素</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄。如果是java窗口并且窗口句柄和元素句柄不一致，需要使用getElementWindow获取窗口句柄。 getElementWindow参数的xpath，Aibote Tool应当使用正常模式下获取的XPATH路径，不要 “勾选java窗口” 复选按钮。对话框子窗口，需要获取对应的窗口句柄操作</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>msg</strong> (<em>number</em>) – 单击左键:1 单击右键:2 按下左键:3 弹起左键:4 按下右键:5 弹起右键:6 双击左键:7 双击右键:8</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-33-33-1" class="sphinx-tabs-panel" hidden="true" id="panel-33-33-1" name="33-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.click_element">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">click_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">typ</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.click_element" title="永久链接至目标">#</a></dt>
<dd><p>点击元素</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>typ</strong> – 操作类型，单击左键:1 单击右键:2 按下左键:3 弹起左键:4 按下右键:5 弹起右键:6 双击左键:7 双击右键:8</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="invokeelement">
<h3>执行元素默认操作(一般是点击操作) <code class="docutils literal notranslate"><span class="pre">invokeElement()</span></code><a class="headerlink" href="#invokeelement" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-34-34-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-34-34-0" name="34-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-34-34-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-34-34-1" name="34-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-34-34-0" class="sphinx-tabs-panel" id="panel-34-34-0" name="34-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.invokeElement">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">invokeElement</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.invokeElement" title="永久链接至目标">#</a></dt>
<dd><p>执行元素默认操作(一般是点击操作)</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄。</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-34-34-1" class="sphinx-tabs-panel" hidden="true" id="panel-34-34-1" name="34-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id15">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id15" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
<section id="setelementfocus">
<h3>设置元素作为焦点 <code class="docutils literal notranslate"><span class="pre">setElementFocus()</span></code><a class="headerlink" href="#setelementfocus" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-35-35-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-35-35-0" name="35-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-35-35-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-35-35-1" name="35-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-35-35-0" class="sphinx-tabs-panel" id="panel-35-35-0" name="35-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.setElementFocus">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setElementFocus</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.setElementFocus" title="永久链接至目标">#</a></dt>
<dd><p>设置指定元素作为焦点</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-35-35-1" class="sphinx-tabs-panel" hidden="true" id="panel-35-35-1" name="35-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.set_element_focus">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">set_element_focus</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.set_element_focus" title="永久链接至目标">#</a></dt>
<dd><p>设置元素作为焦点</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="setelementvalue">
<h3>设置元素文本 <code class="docutils literal notranslate"><span class="pre">setElementValue()</span></code><a class="headerlink" href="#setelementvalue" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-36-36-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-36-36-0" name="36-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-36-36-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-36-36-1" name="36-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-36-36-0" class="sphinx-tabs-panel" id="panel-36-36-0" name="36-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.setElementValue">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setElementValue</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.setElementValue" title="永久链接至目标">#</a></dt>
<dd><p>设置元素文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄。如果是java窗口并且窗口句柄和元素句柄不一致，需要使用getElementWindow获取窗口句柄。 getElementWindow参数的xpath，Aibote Tool应当使用正常模式下获取的XPATH路径，不要 “勾选java窗口” 复选按钮。对话框子窗口，需要获取对应的窗口句柄操作</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>value</strong> (<em>string</em>) – 要设置的内容</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-36-36-1" class="sphinx-tabs-panel" hidden="true" id="panel-36-36-1" name="36-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.set_element_value">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">set_element_value</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.set_element_value" title="永久链接至目标">#</a></dt>
<dd><p>设置元素文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>value</strong> – 要设置的内容</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="setelementscroll">
<h3>滚动元素 <code class="docutils literal notranslate"><span class="pre">setElementScroll()</span></code><a class="headerlink" href="#setelementscroll" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-37-37-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-37-37-0" name="37-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-37-37-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-37-37-1" name="37-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-37-37-0" class="sphinx-tabs-panel" id="panel-37-37-0" name="37-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.setElementScroll">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setElementScroll</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">horizontalPercent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">verticalPercent</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.setElementScroll" title="永久链接至目标">#</a></dt>
<dd><p>滚动元素</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>horizontalPercent</strong> (<em>number</em>) – 水平百分比 -1不滚动</p></li>
<li><p><strong>verticalPercent</strong> (<em>number</em>) – 垂直百分比 -1不滚动</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-37-37-1" class="sphinx-tabs-panel" hidden="true" id="panel-37-37-1" name="37-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.scroll_element">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">scroll_element</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">horizontal</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vertical</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">interval_time</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.scroll_element" title="永久链接至目标">#</a></dt>
<dd><p>滚动元素</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>horizontal</strong> – 水平百分比 -1不滚动</p></li>
<li><p><strong>vertical</strong> – 垂直百分比 -1不滚动</p></li>
<li><p><strong>wait_time</strong> – 等待时间，默认取 self.wait_timeout；</p></li>
<li><p><strong>interval_time</strong> – 轮询间隔时间，默认取 self.interval_timeout；</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="isselected">
<h3>单/复选框是否选中 <code class="docutils literal notranslate"><span class="pre">isSelected()</span></code><a class="headerlink" href="#isselected" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-38-38-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-38-38-0" name="38-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-38-38-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-38-38-1" name="38-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-38-38-0" class="sphinx-tabs-panel" id="panel-38-38-0" name="38-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.isSelected">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">isSelected</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.isSelected" title="永久链接至目标">#</a></dt>
<dd><p>单/复选框是否选中</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-38-38-1" class="sphinx-tabs-panel" hidden="true" id="panel-38-38-1" name="38-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id16">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id16" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
<section id="closewindow">
<h3>关闭窗口 <code class="docutils literal notranslate"><span class="pre">closeWindow()</span></code><a class="headerlink" href="#closewindow" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-39-39-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-39-39-0" name="39-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-39-39-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-39-39-1" name="39-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-39-39-0" class="sphinx-tabs-panel" id="panel-39-39-0" name="39-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.closeWindow">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">closeWindow</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.closeWindow" title="永久链接至目标">#</a></dt>
<dd><p>关闭窗口</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄。如果是java窗口并且窗口句柄和元素句柄不一致，需要使用getElementWindow获取窗口句柄。 getElementWindow参数的xpath，Aibote Tool应当使用正常模式下获取的XPATH路径，不要 “勾选java窗口” 复选按钮。对话框子窗口，需要获取对应的窗口句柄操作</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-39-39-1" class="sphinx-tabs-panel" hidden="true" id="panel-39-39-1" name="39-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.close_window">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">close_window</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.close_window" title="永久链接至目标">#</a></dt>
<dd><p>关闭窗口</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="setwindowstate">
<h3>设置窗口状态 <code class="docutils literal notranslate"><span class="pre">setWindowState()</span></code><a class="headerlink" href="#setwindowstate" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-40-40-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-40-40-0" name="40-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-40-40-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-40-40-1" name="40-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-40-40-0" class="sphinx-tabs-panel" id="panel-40-40-0" name="40-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.setWindowState">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setWindowState</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">state</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.setWindowState" title="永久链接至目标">#</a></dt>
<dd><p>设置窗口状态</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> (<em>string|number</em>) – 窗口句柄。如果是java窗口并且窗口句柄和元素句柄不一致，需要使用getElementWindow获取窗口句柄。 getElementWindow参数的xpath，Aibote Tool应当使用正常模式下获取的XPATH路径，不要 “勾选java窗口” 复选按钮。对话框子窗口，需要获取对应的窗口句柄操作</p></li>
<li><p><strong>xpath</strong> (<em>string</em>) – 元素路径</p></li>
<li><p><strong>state</strong> (<em>number</em>) – 0正常 1最大化 2 最小化</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-40-40-1" class="sphinx-tabs-panel" hidden="true" id="panel-40-40-1" name="40-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.set_element_state">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">set_element_state</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hwnd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">xpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">state</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.set_element_state" title="永久链接至目标">#</a></dt>
<dd><p>设置窗口状态</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hwnd</strong> – 窗口句柄</p></li>
<li><p><strong>xpath</strong> – 元素路径</p></li>
<li><p><strong>state</strong> – 0正常 1最大化 2 最小化</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id17">
<h2>系统剪切板<a class="headerlink" href="#id17" title="此标题的永久链接">#</a></h2>
<section id="setclipboardtext">
<h3>设置剪切板内容 <code class="docutils literal notranslate"><span class="pre">setClipboardText()</span></code><a class="headerlink" href="#setclipboardtext" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-41-41-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-41-41-0" name="41-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-41-41-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-41-41-1" name="41-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-41-41-0" class="sphinx-tabs-panel" id="panel-41-41-0" name="41-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.setClipboardText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">setClipboardText</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.setClipboardText" title="永久链接至目标">#</a></dt>
<dd><p>设置剪切板文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text</strong> (<em>string</em>) – 设置的文本</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true 失败返回 false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-41-41-1" class="sphinx-tabs-panel" hidden="true" id="panel-41-41-1" name="41-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.set_clipboard_text">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">set_clipboard_text</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.set_clipboard_text" title="永久链接至目标">#</a></dt>
<dd><p>设置剪切板内容</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>text</strong> – 要设置的内容</p>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="getclipboardtext">
<h3>获取剪切板内容 <code class="docutils literal notranslate"><span class="pre">getClipboardText()</span></code><a class="headerlink" href="#getclipboardtext" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-42-42-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-42-42-0" name="42-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-42-42-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-42-42-1" name="42-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-42-42-0" class="sphinx-tabs-panel" id="panel-42-42-0" name="42-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getClipboardText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getClipboardText</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getClipboardText" title="永久链接至目标">#</a></dt>
<dd><p>获取剪切板文本</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;string&gt;</strong> – 返回剪切板文本</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-42-42-1" class="sphinx-tabs-panel" hidden="true" id="panel-42-42-1" name="42-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.get_clipboard_text">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">get_clipboard_text</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.get_clipboard_text" title="永久链接至目标">#</a></dt>
<dd><p>设置剪切板内容</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id18">
<h2>启动进程<a class="headerlink" href="#id18" title="此标题的永久链接">#</a></h2>
<section id="startprocess">
<h3>启动进程 <code class="docutils literal notranslate"><span class="pre">startProcess()</span></code><a class="headerlink" href="#startprocess" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-43-43-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-43-43-0" name="43-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-43-43-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-43-43-1" name="43-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-43-43-0" class="sphinx-tabs-panel" id="panel-43-43-0" name="43-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.startProcess">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">startProcess</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">commandLine</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">showWindow=true</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">isWait=false</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.startProcess" title="永久链接至目标">#</a></dt>
<dd><p>启动指定程序</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>commandLine</strong> (<em>string</em>) – 启动命令行</p></li>
<li><p><strong>showWindow</strong> (<em>boolean</em>) – 是否显示窗口。可选参数,默认显示窗口</p></li>
<li><p><strong>isWait</strong> (<em>boolean</em>) – 是否等待程序结束。可选参数,默认不等待</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true,失败返回false</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-43-43-1" class="sphinx-tabs-panel" hidden="true" id="panel-43-43-1" name="43-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.start_process">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">start_process</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cmd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_window</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_wait</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.start_process" title="永久链接至目标">#</a></dt>
<dd><p>执行cmd命令</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cmd</strong> – 命令</p></li>
<li><p><strong>show_window</strong> – 是否显示窗口，默认显示</p></li>
<li><p><strong>is_wait</strong> – 是否等待程序结束， 默认不等待</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="cmd">
<h2>执行cmd命令<a class="headerlink" href="#cmd" title="此标题的永久链接">#</a></h2>
<section id="cmd-executecommand">
<h3>执行cmd命令 <code class="docutils literal notranslate"><span class="pre">executeCommand()</span></code><a class="headerlink" href="#cmd-executecommand" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-44-44-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-44-44-0" name="44-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-44-44-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-44-44-1" name="44-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-44-44-0" class="sphinx-tabs-panel" id="panel-44-44-0" name="44-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.executeCommand">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">executeCommand</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">command</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">waitTimeout=300</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.executeCommand" title="永久链接至目标">#</a></dt>
<dd><p>执行cmd命令</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>command</strong> (<em>string</em>) – cmd命令，不能含 “cmd”字串</p></li>
<li><p><strong>waitTimeout</strong> (<em>number</em>) – 可选参数，等待结果返回超时，单位毫秒，默认300毫秒</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 返回cmd执行结果</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-44-44-1" class="sphinx-tabs-panel" hidden="true" id="panel-44-44-1" name="44-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id19">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">start_process</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cmd</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_window</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_wait</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#id19" title="永久链接至目标">#</a></dt>
<dd><p>执行cmd命令</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cmd</strong> – 命令</p></li>
<li><p><strong>show_window</strong> – 是否显示窗口，默认显示</p></li>
<li><p><strong>is_wait</strong> – 是否等待程序结束， 默认不等待</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="url">
<h2>指定url下载文件<a class="headerlink" href="#url" title="此标题的永久链接">#</a></h2>
<section id="url-downloadfile">
<h3>指定url下载文件 <code class="docutils literal notranslate"><span class="pre">downloadFile()</span></code><a class="headerlink" href="#url-downloadfile" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-45-45-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-45-45-0" name="45-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-45-45-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-45-45-1" name="45-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-45-45-0" class="sphinx-tabs-panel" id="panel-45-45-0" name="45-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.downloadFile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">downloadFile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filePath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">isWait</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.downloadFile" title="永久链接至目标">#</a></dt>
<dd><p>指定url下载文件</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>string</em>) – 文件地址</p></li>
<li><p><strong>filePath</strong> (<em>string</em>) – 文件保存的路径</p></li>
<li><p><strong>isWait</strong> (<em>boolean</em>) – 是否等待.为true时,等待下载完成</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-45-45-1" class="sphinx-tabs-panel" hidden="true" id="panel-45-45-1" name="45-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="AiBot.WinBotMain.download_file">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">download_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file_path</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_wait</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">bool</span></span></span><a class="headerlink" href="#AiBot.WinBotMain.download_file" title="永久链接至目标">#</a></dt>
<dd><p>下载文件</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> – 文件地址</p></li>
<li><p><strong>file_path</strong> – 文件保存的路径</p></li>
<li><p><strong>is_wait</strong> – 是否等待下载完成</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="excel">
<h2>Excel文档<a class="headerlink" href="#excel" title="此标题的永久链接">#</a></h2>
<section id="excel-openexcel">
<h3>打开excel文档 <code class="docutils literal notranslate"><span class="pre">openExcel()</span></code><a class="headerlink" href="#excel-openexcel" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-46-46-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-46-46-0" name="46-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-46-46-0" class="sphinx-tabs-panel" id="panel-46-46-0" name="46-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.openExcel">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">openExcel</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">excelPath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.openExcel" title="永久链接至目标">#</a></dt>
<dd><p>打开excel文档</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>excelPath</strong> (<em>string</em>) – excle路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;Object&gt;</strong> – 成功返回excel对象，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="excel-openexcelsheet">
<h3>打开excel表格 <code class="docutils literal notranslate"><span class="pre">openExcelSheet()</span></code><a class="headerlink" href="#excel-openexcelsheet" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-47-47-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-47-47-0" name="47-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-47-47-0" class="sphinx-tabs-panel" id="panel-47-47-0" name="47-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.openExcelSheet">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">openExcelSheet</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">excelObject</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sheetName</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.openExcelSheet" title="永久链接至目标">#</a></dt>
<dd><p>打开excel表格</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>excelObject</strong> (<em>Object</em>) – excel对象</p></li>
<li><p><strong>sheetName</strong> (<em>string</em>) – 表名</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;Object&gt;</strong> – 成功返回sheet对象，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="excel-saveexcel">
<h3>保存/关闭excel文档 <code class="docutils literal notranslate"><span class="pre">saveExcel()</span></code><a class="headerlink" href="#excel-saveexcel" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-48-48-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-48-48-0" name="48-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-48-48-0" class="sphinx-tabs-panel" id="panel-48-48-0" name="48-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.saveExcel">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">saveExcel</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">excelObject</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.saveExcel" title="永久链接至目标">#</a></dt>
<dd><p>保存excel文档</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>excelObject</strong> (<em>Object</em>) – excel对象</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="excel-writeexcelnum">
<h3>写入数字到excel表格 <code class="docutils literal notranslate"><span class="pre">writeExcelNum()</span></code><a class="headerlink" href="#excel-writeexcelnum" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-49-49-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-49-49-0" name="49-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-49-49-0" class="sphinx-tabs-panel" id="panel-49-49-0" name="49-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.writeExcelNum">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">writeExcelNum</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sheetObject</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">row</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">col</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.writeExcelNum" title="永久链接至目标">#</a></dt>
<dd><p>写入数字到excel表格</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sheetObject</strong> (<em>Object</em>) – sheet对象</p></li>
<li><p><strong>row</strong> (<em>number</em>) – 行</p></li>
<li><p><strong>col</strong> (<em>number</em>) – 列</p></li>
<li><p><strong>value</strong> (<em>number</em>) – 写入的值</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="excel-writeexcelstr">
<h3>写入字串到excel表格 <code class="docutils literal notranslate"><span class="pre">writeExcelStr()</span></code><a class="headerlink" href="#excel-writeexcelstr" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-50-50-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-50-50-0" name="50-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-50-50-0" class="sphinx-tabs-panel" id="panel-50-50-0" name="50-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.writeExcelStr">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">writeExcelStr</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sheetObject</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">row</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">col</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strValue</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.writeExcelStr" title="永久链接至目标">#</a></dt>
<dd><p>写入字符串到excel表格</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sheetObject</strong> (<em>Object</em>) – sheet对象</p></li>
<li><p><strong>row</strong> (<em>number</em>) – 行</p></li>
<li><p><strong>col</strong> (<em>number</em>) – 列</p></li>
<li><p><strong>strValue</strong> (<em>string</em>) – 写入的值</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="excel-readexcelnum">
<h3>读取excel表格数字 <code class="docutils literal notranslate"><span class="pre">readExcelNum()</span></code><a class="headerlink" href="#excel-readexcelnum" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-51-51-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-51-51-0" name="51-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-51-51-0" class="sphinx-tabs-panel" id="panel-51-51-0" name="51-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.readExcelNum">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">readExcelNum</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sheetObject</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">row</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">col</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.readExcelNum" title="永久链接至目标">#</a></dt>
<dd><p>读取excel表格数字</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sheetObject</strong> (<em>Object</em>) – sheet对象</p></li>
<li><p><strong>row</strong> (<em>number</em>) – 行</p></li>
<li><p><strong>col</strong> (<em>number</em>) – 列</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;number&gt;</strong> – 返回读取到的数字</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="excel-readexcelstr">
<h3>读取excel表格字串 <code class="docutils literal notranslate"><span class="pre">readExcelStr()</span></code><a class="headerlink" href="#excel-readexcelstr" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-52-52-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-52-52-0" name="52-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-52-52-0" class="sphinx-tabs-panel" id="panel-52-52-0" name="52-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.readExcelStr">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">readExcelStr</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sheetObject</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">row</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">col</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.readExcelStr" title="永久链接至目标">#</a></dt>
<dd><p>读取excel表格字串</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sheetObject</strong> (<em>Object</em>) – sheet对象</p></li>
<li><p><strong>row</strong> (<em>number</em>) – 行</p></li>
<li><p><strong>col</strong> (<em>number</em>) – 列</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 返回读取到的字符</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="excel-removeexcelrow">
<h3>删除excel表格行 <code class="docutils literal notranslate"><span class="pre">removeExcelRow()</span></code><a class="headerlink" href="#excel-removeexcelrow" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-53-53-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-53-53-0" name="53-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-53-53-0" class="sphinx-tabs-panel" id="panel-53-53-0" name="53-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.removeExcelRow">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">removeExcelRow</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sheetObject</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rowFirst</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rowLast</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.removeExcelRow" title="永久链接至目标">#</a></dt>
<dd><p>删除excel表格行</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sheetObject</strong> (<em>Object</em>) – sheet对象</p></li>
<li><p><strong>rowFirst</strong> (<em>number</em>) – 起始行</p></li>
<li><p><strong>rowLast</strong> (<em>number</em>) – 结束行</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="excel-removeexcelcol">
<h3>删除excel表格列 <code class="docutils literal notranslate"><span class="pre">removeExcelCol()</span></code><a class="headerlink" href="#excel-removeexcelcol" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-54-54-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-54-54-0" name="54-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-54-54-0" class="sphinx-tabs-panel" id="panel-54-54-0" name="54-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.removeExcelCol">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">removeExcelCol</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sheetObject</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">colFirst</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">colLast</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.removeExcelCol" title="永久链接至目标">#</a></dt>
<dd><p>删除excel表格列</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sheetObject</strong> (<em>Object</em>) – sheet对象</p></li>
<li><p><strong>colFirst</strong> (<em>number</em>) – 起始列</p></li>
<li><p><strong>colLast</strong> (<em>number</em>) – 结束列</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="c1">// 代码示例</span><span class="w"></span>
<span class="c1">// 打开excel</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">excelPath</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;d:\\1.xlsx&quot;</span><span class="p">;</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">excelObject</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">openExcel</span><span class="p">(</span><span class="nx">excelPath</span><span class="p">);</span><span class="w"></span>

<span class="c1">// 打开/创建表</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">sheetName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;第1张表&quot;</span><span class="p">;</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">sheetObject</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">openExcelSheet</span><span class="p">(</span><span class="nx">excelObject</span><span class="p">,</span><span class="w"> </span><span class="nx">sheetName</span><span class="p">);</span><span class="w"></span>

<span class="c1">// 写入字符串到第一个表格</span><span class="w"></span>
<span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">writeExcelStr</span><span class="p">(</span><span class="nx">sheetObject</span><span class="p">,</span><span class="w"> </span><span class="mf">0</span><span class="p">,</span><span class="w"> </span><span class="mf">0</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;aibote RPA&quot;</span><span class="p">);</span><span class="w"></span>

<span class="c1">// 读取第一个表格内容</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">text</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">readExcelStr</span><span class="p">(</span><span class="nx">sheetObject</span><span class="p">,</span><span class="w"> </span><span class="mf">0</span><span class="p">,</span><span class="w"> </span><span class="mf">0</span><span class="p">);</span><span class="w"></span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">text</span><span class="p">);</span><span class="w"></span>

<span class="c1">// 保存/关闭excel。如果再次操作需要重新调用openExcel、openExcelSheet 函数</span><span class="w"></span>
<span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">saveExcel</span><span class="p">(</span><span class="nx">excelObject</span><span class="p">);</span><span class="w"></span>
</pre></div>
</div>
</section>
</section>
<section id="id20">
<h2>验证码系统<a class="headerlink" href="#id20" title="此标题的永久链接">#</a></h2>
<section id="getcaptcha">
<h3>识别验证码 <code class="docutils literal notranslate"><span class="pre">getCaptcha()</span></code><a class="headerlink" href="#getcaptcha" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-55-55-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-55-55-0" name="55-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-55-55-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-55-55-1" name="55-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-55-55-0" class="sphinx-tabs-panel" id="panel-55-55-0" name="55-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.getCaptcha">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">getCaptcha</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filePath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">username</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">softId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">codeType</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lenMin=&quot;0&quot;</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.getCaptcha" title="永久链接至目标">#</a></dt>
<dd><p>识别验证码</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filePath</strong> (<em>string</em>) – 图片文件路径</p></li>
<li><p><strong>username</strong> (<em>string</em>) – 用户名</p></li>
<li><p><strong>password</strong> (<em>string</em>) – 密码</p></li>
<li><p><strong>softId</strong> (<em>string</em>) – 软件ID</p></li>
<li><p><strong>codeType</strong> (<em>string</em>) – 图片类型 参考https://www.chaojiying.com/price.html</p></li>
<li><p><strong>lenMin</strong> (<em>string</em>) – 最小位数 默认0为不启用,图片类型为可变位长时可启用这个参数</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;{err_no:number, err_str:string, pic_id:string, pic_str:string, md5:string}&gt;</strong> – 返回JSON err_no,(数值) 返回代码  为0 表示正常，错误代码 参考https://www.chaojiying.com/api-23.html err_str,(字符串) 中文描述的返回信息 pic_id,(字符串) 图片标识号，或图片id号 pic_str,(字符串) 识别出的结果 md5,(字符串) md5校验值,用来校验此条数据返回是否真实有效</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-55-55-1" class="sphinx-tabs-panel" hidden="true" id="panel-55-55-1" name="55-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id21">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id21" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
<section id="errorcaptcha">
<h3>识别报错返分 <code class="docutils literal notranslate"><span class="pre">errorCaptcha()</span></code><a class="headerlink" href="#errorcaptcha" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-56-56-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-56-56-0" name="56-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-56-56-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-56-56-1" name="56-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-56-56-0" class="sphinx-tabs-panel" id="panel-56-56-0" name="56-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.errorCaptcha">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">errorCaptcha</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">username</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">softId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">picId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.errorCaptcha" title="永久链接至目标">#</a></dt>
<dd><p>识别报错返分</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>username</strong> (<em>string</em>) – 用户名</p></li>
<li><p><strong>password</strong> (<em>string</em>) – 密码</p></li>
<li><p><strong>softId</strong> (<em>string</em>) – 软件ID</p></li>
<li><p><strong>picId</strong> (<em>string</em>) – 图片ID 对应 getCaptcha返回值的pic_id 字段</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;{err_no:number, err_str:string}&gt;</strong> – 返回JSON err_no,(数值) 返回代码 err_str,(字符串) 中文描述的返回信息</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-56-56-1" class="sphinx-tabs-panel" hidden="true" id="panel-56-56-1" name="56-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id22">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id22" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
<section id="scorecaptcha">
<h3>查询验证码剩余题分 <code class="docutils literal notranslate"><span class="pre">scoreCaptcha()</span></code><a class="headerlink" href="#scorecaptcha" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-57-57-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-57-57-0" name="57-0" role="tab" tabindex="0">JavaScript</button><button aria-controls="panel-57-57-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-57-57-1" name="57-1" role="tab" tabindex="-1">Python</button></div><div aria-labelledby="tab-57-57-0" class="sphinx-tabs-panel" id="panel-57-57-0" name="57-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.scoreCaptcha">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">scoreCaptcha</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">username</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.scoreCaptcha" title="永久链接至目标">#</a></dt>
<dd><p>查询验证码剩余题分</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>username</strong> (<em>string</em>) – 用户名</p></li>
<li><p><strong>password</strong> (<em>string</em>) – 密码</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;{err_no:number, err_str:string, tifen:string, tifen_lock:string}&gt;</strong> – 返回JSON err_no,(数值) 返回代码 err_str,(字符串) 中文描述的返回信息 tifen,(数值) 题分 tifen_lock,(数值) 锁定题分</p>
</dd>
</dl>
</dd></dl>

</div><div aria-labelledby="tab-57-57-1" class="sphinx-tabs-panel" hidden="true" id="panel-57-57-1" name="57-1" role="tabpanel" tabindex="0"><dl class="py method">
<dt class="sig sig-object py" id="id23">
<span class="sig-prename descclassname"><span class="pre">WinBotMain.</span></span><span class="sig-name descname"><span class="pre">todo</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#id23" title="永久链接至目标">#</a></dt>
<dd></dd></dl>

</div></div>
</section>
</section>
<section id="nlp">
<h2>自然语言处理(NLP)<a class="headerlink" href="#nlp" title="此标题的永久链接">#</a></h2>
<section id="nlp-initnlp">
<h3>初始化NLP <code class="docutils literal notranslate"><span class="pre">initNLP()</span></code><a class="headerlink" href="#nlp-initnlp" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-58-58-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-58-58-0" name="58-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-58-58-0" class="sphinx-tabs-panel" id="panel-58-58-0" name="58-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.initNLP">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">initNLP</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">aipKey</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.initNLP" title="永久链接至目标">#</a></dt>
<dd><p>初始化NLP</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>aipKey</strong> (<em>string</em>) – 密钥</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="chatgpt">
<h3>chatGPT的使用<a class="headerlink" href="#chatgpt" title="此标题的永久链接">#</a></h3>
</section>
<section id="chatgpt-chatgpt">
<h3>使用chatgpt <code class="docutils literal notranslate"><span class="pre">chatgpt()</span></code><a class="headerlink" href="#chatgpt-chatgpt" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-59-59-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-59-59-0" name="59-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-59-59-0" class="sphinx-tabs-panel" id="panel-59-59-0" name="59-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.chatgpt">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">chatgpt</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prompt</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">maxTokens</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">temperature</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stop</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.chatgpt" title="永久链接至目标">#</a></dt>
<dd><p>chatGpt</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model,</strong> (<em>string</em>) – 指定使用的模型,”text-davinci-003”text-curie-001text-babbage-001text-ada-001和自定义微调模型</p></li>
<li><p><strong>prompt,</strong> (<em>string</em>) – 问题</p></li>
<li><p><strong>maxTokens,</strong> (<em>number</em>) – 最大令牌数，大约 3个字符1个令牌，1个汉字2个令牌</p></li>
<li><p><strong>temperature,</strong> (<em>number</em>) – 浮点型，温度，调节结果的创意程度，0一般为单一结果， 1创意度更高</p></li>
<li><p><strong>stop,</strong> (<em>string</em>) – 可选参数，停止结果输出标志，一般用在微调模型上，例如 stop = ‘[“END”]’</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 失败返回null, 成功返回json对象 text 返回的答案内容 finish 为true回答结束，false 还有未输出的答案。我们可以继续 prompt + 输出的答案 获取后续内容，直到finish为true</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="chatgpt-chatgptedit">
<h3>使用chatgpt编辑模式 <code class="docutils literal notranslate"><span class="pre">chatgptEdit()</span></code><a class="headerlink" href="#chatgpt-chatgptedit" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-60-60-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-60-60-0" name="60-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-60-60-0" class="sphinx-tabs-panel" id="panel-60-60-0" name="60-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.chatgptEdit">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">chatgptEdit</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">input</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">instruction</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">maxTokens</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">temperature</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.chatgptEdit" title="永久链接至目标">#</a></dt>
<dd><p>chatGpt编辑模式</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model,</strong> (<em>string</em>) – 指定使用的模型， “text-davinci-edit-001””code-davinci-edit-001”</p></li>
<li><p><strong>input,</strong> (<em>string</em>) – 输入要编辑的内容</p></li>
<li><p><strong>instruction,</strong> (<em>string</em>) – 提示如何去编辑</p></li>
<li><p><strong>maxTokens,</strong> (<em>number</em>) – 最大令牌数，大约 3个字符1个令牌，1个汉字2个令牌</p></li>
<li><p><strong>temperature,</strong> (<em>number</em>) – 浮点型，温度，调节结果的创意程度，0一般为单一结果， 1创意度更高</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 失败返回null, 成功返回json对象 text 返回的答案内容 finish 为true回答结束，false 还有未输出的答案。我们可以继续 prompt + 输出的答案 获取后续内容，直到finish为true</p>
</dd>
</dl>
</dd></dl>

</div></div>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="c1">// 代码示例</span><span class="w"></span>
<span class="c1">// 初始化</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">bRet</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">initNLP</span><span class="p">(</span><span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;</span><span class="p">);</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="nx">bRet</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="c1">// return;</span><span class="w"></span>

<span class="c1">// chatgpt</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">chatgpt</span><span class="p">(</span><span class="s2">&quot;text-davinci-003&quot;</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;怎么称呼你？&quot;</span><span class="p">,</span><span class="w"> </span><span class="mf">256</span><span class="p">,</span><span class="w"> </span><span class="mf">0.7</span><span class="p">);</span><span class="w"></span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">result</span><span class="p">[</span><span class="s2">&quot;text&quot;</span><span class="p">]);</span><span class="w"></span>

<span class="c1">// chatgpt 循环获取答案</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">prompt</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;请介绍下Aibote的应用场景，不少于500字&quot;</span><span class="p">;</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">isFinish</span><span class="p">;</span><span class="w"></span>
<span class="k">do</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="nx">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">chatgpt</span><span class="p">(</span><span class="s2">&quot;text-davinci-003&quot;</span><span class="p">,</span><span class="w"> </span><span class="nx">prompt</span><span class="p">,</span><span class="w"> </span><span class="mf">256</span><span class="p">,</span><span class="w"> </span><span class="mf">0.7</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="nx">isFinish</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">result</span><span class="p">[</span><span class="s2">&quot;finish&quot;</span><span class="p">];</span><span class="w"></span>
<span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="nx">isFinish</span><span class="p">)</span><span class="w"></span>
<span class="w">        </span><span class="nx">prompt</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="nx">result</span><span class="p">[</span><span class="s2">&quot;text&quot;</span><span class="p">];</span><span class="w"></span>

<span class="w">    </span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">result</span><span class="p">[</span><span class="s2">&quot;text&quot;</span><span class="p">]);</span><span class="w"></span>
<span class="p">}</span><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="nx">isFinish</span><span class="p">)</span><span class="w"></span>

<span class="c1">// chatgptEdit</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="nx">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">await</span><span class="w"> </span><span class="nx">windowsBot</span><span class="p">.</span><span class="nx">chatgptEdit</span><span class="p">(</span><span class="s2">&quot;text-davinci-edit-001&quot;</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;你好码？&quot;</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;修正错误文字&quot;</span><span class="p">,</span><span class="w"> </span><span class="mf">256</span><span class="p">,</span><span class="w"> </span><span class="mf">0</span><span class="p">);</span><span class="w"></span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">result</span><span class="p">[</span><span class="s2">&quot;text&quot;</span><span class="p">]);</span><span class="w"></span>
</pre></div>
</div>
</section>
<section id="id24">
<h3>训练模型<a class="headerlink" href="#id24" title="此标题的永久链接">#</a></h3>
</section>
<section id="createfinetune">
<h3>创建微调模型 <code class="docutils literal notranslate"><span class="pre">createFineTune()</span></code><a class="headerlink" href="#createfinetune" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-61-61-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-61-61-0" name="61-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-61-61-0" class="sphinx-tabs-panel" id="panel-61-61-0" name="61-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.createFineTune">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">createFineTune</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fileId</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">baseModel</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">suffix</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.createFineTune" title="永久链接至目标">#</a></dt>
<dd><p>创建微调模型</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fileId,</strong> (<em>string</em>) – 文件id，可通过 uploadTrainFile函数上传并获取文件id</p></li>
<li><p><strong>baseModel,</strong> (<em>string</em>) – 基础模型，可以是以下参数之一，”ada”, “babbage”, “curie”, “davinci”和自定义微调模型</p></li>
<li><p><strong>suffix,</strong> (<em>string</em>) – 微调生成的模型名称后缀</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回微调id，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="listfinetunes">
<h3>列出所有微调信息 <code class="docutils literal notranslate"><span class="pre">listFineTunes()</span></code><a class="headerlink" href="#listfinetunes" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-62-62-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-62-62-0" name="62-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-62-62-0" class="sphinx-tabs-panel" id="panel-62-62-0" name="62-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.listFineTunes">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">listFineTunes</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.listFineTunes" title="永久链接至目标">#</a></dt>
<dd><p>列出所有微调信息</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="cancelfinetune">
<h3>取消正在微调的作业 <code class="docutils literal notranslate"><span class="pre">cancelFineTune()</span></code><a class="headerlink" href="#cancelfinetune" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-63-63-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-63-63-0" name="63-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-63-63-0" class="sphinx-tabs-panel" id="panel-63-63-0" name="63-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.cancelFineTune">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">cancelFineTune</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fineTuneId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.cancelFineTune" title="永久链接至目标">#</a></dt>
<dd><p>取消正在微调的作业</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fineTuneId,</strong> (<em>string</em>) – 微调id</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="deletefinetunemodel">
<h3>删除微调模型 <code class="docutils literal notranslate"><span class="pre">deleteFineTuneModel()</span></code><a class="headerlink" href="#deletefinetunemodel" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-64-64-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-64-64-0" name="64-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-64-64-0" class="sphinx-tabs-panel" id="panel-64-64-0" name="64-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.deleteFineTuneModel">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">deleteFineTuneModel</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fineTuneId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.deleteFineTuneModel" title="永久链接至目标">#</a></dt>
<dd><p>删除微调模型</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fineTuneId,</strong> (<em>string</em>) – 微调id</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="id25">
<h3>训练数据文件<a class="headerlink" href="#id25" title="此标题的永久链接">#</a></h3>
</section>
<section id="uploadtrainfile">
<h3>上传训练文件到服务器 <code class="docutils literal notranslate"><span class="pre">uploadTrainFile()</span></code><a class="headerlink" href="#uploadtrainfile" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-65-65-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-65-65-0" name="65-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-65-65-0" class="sphinx-tabs-panel" id="panel-65-65-0" name="65-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.uploadTrainFile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">uploadTrainFile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filePath</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.uploadTrainFile" title="永久链接至目标">#</a></dt>
<dd><p>上传训练文件到服务器</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filePath,</strong> (<em>string</em>) – 文件路径，不支持中文路径</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回文件id，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="listtrainfile">
<h3>列出单个训练文件信息 <code class="docutils literal notranslate"><span class="pre">listTrainFile()</span></code><a class="headerlink" href="#listtrainfile" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-66-66-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-66-66-0" name="66-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-66-66-0" class="sphinx-tabs-panel" id="panel-66-66-0" name="66-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.listTrainFile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">listTrainFile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.listTrainFile" title="永久链接至目标">#</a></dt>
<dd><p>列出指定id的文件信息</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fileId,</strong> (<em>string</em>) – 文件id</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回json对象，失败返回null bytes 训练数据文件的大小 fileName 训练数据文件的名称 fileId 训练数据文件的id purpose 文件的意图 例如：”fine-tune” 意图为 用作微调模型</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="listtrainfiles">
<h3>列出所有训练文件信息 <code class="docutils literal notranslate"><span class="pre">listTrainFiles()</span></code><a class="headerlink" href="#listtrainfiles" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-67-67-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-67-67-0" name="67-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-67-67-0" class="sphinx-tabs-panel" id="panel-67-67-0" name="67-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.listTrainFiles">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">listTrainFiles</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.listTrainFiles" title="永久链接至目标">#</a></dt>
<dd><p>列出所有训练文件信息</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p></p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="downloadtrainfile">
<h3>下载训练文件内容 <code class="docutils literal notranslate"><span class="pre">downloadTrainFile()</span></code><a class="headerlink" href="#downloadtrainfile" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-68-68-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-68-68-0" name="68-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-68-68-0" class="sphinx-tabs-panel" id="panel-68-68-0" name="68-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.downloadTrainFile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">downloadTrainFile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.downloadTrainFile" title="永久链接至目标">#</a></dt>
<dd><p>下载训练文件内容</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fileId,</strong> (<em>string</em>) – 文件id</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回文件内容，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="deletetrainfile">
<h3>删除训练文件 <code class="docutils literal notranslate"><span class="pre">deleteTrainFile()</span></code><a class="headerlink" href="#deletetrainfile" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-69-69-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-69-69-0" name="69-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-69-69-0" class="sphinx-tabs-panel" id="panel-69-69-0" name="69-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.deleteTrainFile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">deleteTrainFile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fileId</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.deleteTrainFile" title="永久链接至目标">#</a></dt>
<dd><p>删除训练文件</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fileId,</strong> (<em>string</em>) – 文件id</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
<section id="id26">
<h2>语音合成/识别服务<a class="headerlink" href="#id26" title="此标题的永久链接">#</a></h2>
<section id="initspeechservice">
<h3>初始化语音服务 <code class="docutils literal notranslate"><span class="pre">initSpeechService()</span></code><a class="headerlink" href="#initspeechservice" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-70-70-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-70-70-0" name="70-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-70-70-0" class="sphinx-tabs-panel" id="panel-70-70-0" name="70-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.initSpeechService">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">initSpeechService</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">speechKey</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">speechRegion</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.initSpeechService" title="永久链接至目标">#</a></dt>
<dd><p>初始化语音服务</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>speechKey,</strong> (<em>string</em>) – 密钥</p></li>
<li><p><strong>speechRegion,</strong> (<em>string</em>) – 区域</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 总是返回true</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="id27">
<h3>语音识别<a class="headerlink" href="#id27" title="此标题的永久链接">#</a></h3>
</section>
<section id="audiofiletotext">
<h3>音频文件转文本 <code class="docutils literal notranslate"><span class="pre">audioFileToText()</span></code><a class="headerlink" href="#audiofiletotext" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-71-71-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-71-71-0" name="71-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-71-71-0" class="sphinx-tabs-panel" id="panel-71-71-0" name="71-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.audioFileToText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">audioFileToText</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filePath</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">language</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.audioFileToText" title="永久链接至目标">#</a></dt>
<dd><p>音频文件转文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filePath,</strong> (<em>string</em>) – 音频文件路径</p></li>
<li><p><strong>language,</strong> (<em>string</em>) – 语言，参考开发文档 语言和发音人</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回转换后的音频文本，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="microphonetotext">
<h3>麦克风输入音频换文本 <code class="docutils literal notranslate"><span class="pre">microphoneToText()</span></code><a class="headerlink" href="#microphonetotext" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-72-72-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-72-72-0" name="72-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-72-72-0" class="sphinx-tabs-panel" id="panel-72-72-0" name="72-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.microphoneToText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">microphoneToText</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">language</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.microphoneToText" title="永久链接至目标">#</a></dt>
<dd><p>麦克风输入流转换文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>language,</strong> (<em>string</em>) – 语言，参考开发文档 语言和发音人</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回转换后的音频文本，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="id28">
<h3>合成语音<a class="headerlink" href="#id28" title="此标题的永久链接">#</a></h3>
</section>
<section id="texttobullhorn">
<h3>文本合成语音输出到扬声器播放 <code class="docutils literal notranslate"><span class="pre">textToBullhorn()</span></code><a class="headerlink" href="#texttobullhorn" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-73-73-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-73-73-0" name="73-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-73-73-0" class="sphinx-tabs-panel" id="panel-73-73-0" name="73-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.textToBullhorn">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">textToBullhorn</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text，要转换语音的文本</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">language，语言，参考开发文档</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">voiceName，发音人，参考开发文档</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.textToBullhorn" title="永久链接至目标">#</a></dt>
<dd><p>文本合成音频到扬声器</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text，要转换语音的文本</strong> (<em>string</em>) – </p></li>
<li><p><strong>language，语言，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
<li><p><strong>voiceName，发音人，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="texttoaudiofile">
<h3>文本合成语音保存到本地音频文件 <code class="docutils literal notranslate"><span class="pre">textToAudioFile()</span></code><a class="headerlink" href="#texttoaudiofile" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-74-74-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-74-74-0" name="74-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-74-74-0" class="sphinx-tabs-panel" id="panel-74-74-0" name="74-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.textToAudioFile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">textToAudioFile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">text，要转换语音的文本</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">language，语言，参考开发文档</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">voiceName，发音人，参考开发文档</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">audioPath，保存音频文件路径</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.textToAudioFile" title="永久链接至目标">#</a></dt>
<dd><p>文本合成音频并保存到文件</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>text，要转换语音的文本</strong> (<em>string</em>) – </p></li>
<li><p><strong>language，语言，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
<li><p><strong>voiceName，发音人，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
<li><p><strong>audioPath，保存音频文件路径</strong> (<em>string</em>) – </p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="ssml">
<h3>SSML格式合成语音<a class="headerlink" href="#ssml" title="此标题的永久链接">#</a></h3>
</section>
<section id="ssml-ssmltobullhorn">
<h3>SSML文本格式合成音频到扬声器 <code class="docutils literal notranslate"><span class="pre">SSMLToBullhorn()</span></code><a class="headerlink" href="#ssml-ssmltobullhorn" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-75-75-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-75-75-0" name="75-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-75-75-0" class="sphinx-tabs-panel" id="panel-75-75-0" name="75-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.SSMLToBullhorn">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">SSMLToBullhorn</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ssmlPath，SSML文本路径</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">language，语言，参考开发文档</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">voiceName，发音人，参考开发文档</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.SSMLToBullhorn" title="永久链接至目标">#</a></dt>
<dd><p>SSML文本格式合成音频到扬声器</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ssmlPath，SSML文本路径</strong> (<em>string</em>) – </p></li>
<li><p><strong>language，语言，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
<li><p><strong>voiceName，发音人，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="ssml-ssmltofile">
<h3>SSML文本格式合成音频到扬声器 <code class="docutils literal notranslate"><span class="pre">SSMLToFile()</span></code><a class="headerlink" href="#ssml-ssmltofile" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-76-76-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-76-76-0" name="76-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-76-76-0" class="sphinx-tabs-panel" id="panel-76-76-0" name="76-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.SSMLToFile">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">SSMLToFile</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ssmlPath，SSML文本路径</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">language，语言，参考开发文档</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">voiceName，发音人，参考开发文档</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">audioPath，保存音频文件路径</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.SSMLToFile" title="永久链接至目标">#</a></dt>
<dd><p>SSML文本格式合成音频并保存到文件</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ssmlPath，SSML文本路径</strong> (<em>string</em>) – </p></li>
<li><p><strong>language，语言，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
<li><p><strong>voiceName，发音人，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
<li><p><strong>audioPath，保存音频文件路径</strong> (<em>string</em>) – </p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;boolean&gt;</strong> – 成功返回true，失败返回false</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="id29">
<h3>语音翻译<a class="headerlink" href="#id29" title="此标题的永久链接">#</a></h3>
</section>
<section id="microphonetranslationtext">
<h3>麦克风音频翻译成目标语言文本 <code class="docutils literal notranslate"><span class="pre">microphoneTranslationText()</span></code><a class="headerlink" href="#microphonetranslationtext" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-77-77-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-77-77-0" name="77-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-77-77-0" class="sphinx-tabs-panel" id="panel-77-77-0" name="77-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.microphoneTranslationText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">microphoneTranslationText</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sourceLanguage，要翻译的语言，参考开发文档</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">targetLanguage，翻译后的语言，参考开发文档</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.microphoneTranslationText" title="永久链接至目标">#</a></dt>
<dd><p>麦克风音频翻译成目标语言文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sourceLanguage，要翻译的语言，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
<li><p><strong>targetLanguage，翻译后的语言，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回翻译后的语言文本，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="audiofiletranslationtext">
<h3>音频文件翻译成目标语言文本 <code class="docutils literal notranslate"><span class="pre">audioFileTranslationText()</span></code><a class="headerlink" href="#audiofiletranslationtext" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-78-78-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-78-78-0" name="78-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-78-78-0" class="sphinx-tabs-panel" id="panel-78-78-0" name="78-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.audioFileTranslationText">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">audioFileTranslationText</span></span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">audioPath，</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sourceLanguage，要翻译的语言，参考开发文档</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">targetLanguage，翻译后的语言，参考开发文档</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.audioFileTranslationText" title="永久链接至目标">#</a></dt>
<dd><p>音频文件翻译成目标语言文本</p>
<dl class="field-list simple">
<dt class="field-odd">参数<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>audioPath，</strong> (<em>string</em>) – 要翻译的音频文件路径</p></li>
<li><p><strong>sourceLanguage，要翻译的语言，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
<li><p><strong>targetLanguage，翻译后的语言，参考开发文档</strong> (<em>string</em>) – 语言和发音人</p></li>
</ul>
</dd>
<dt class="field-even">返回<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>Promise.&lt;string&gt;</strong> – 成功返回翻译后的语言文本，失败返回null</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
<section id="id30">
<h3>语言和发音人<a class="headerlink" href="#id30" title="此标题的永久链接">#</a></h3>
<section id="id31">
<h4>语言<a class="headerlink" href="#id31" title="此标题的永久链接">#</a></h4>
<blockquote>
<div><ul class="simple">
<li><p>中文（普通话，简体）: “zh-cn”</p></li>
<li><p>中文（粤语，简体）: “yue-CN”</p></li>
<li><p>英语（美国）: “en-US”</p></li>
<li><p>英语（英国）: “en-GB”</p></li>
</ul>
</div></blockquote>
</section>
<section id="id32">
<h4>发音人<a class="headerlink" href="#id32" title="此标题的永久链接">#</a></h4>
<blockquote>
<div><ul class="simple">
<li><dl class="simple">
<dt>中文（普通话，简体）:</dt><dd><ul>
<li><p>晓辰: zh-cn-XiaochenNeural（女）</p></li>
<li><p>晓涵: zh-cn-XiaohanNeural（女）</p></li>
<li><p>晓梦: zh-cn-XiaomengNeural（女）</p></li>
<li><p>晓墨: zh-cn-XiaomoNeural（女）</p></li>
<li><p>晓秋: zh-cn-XiaoqiuNeural（女）</p></li>
<li><p>晓睿: zh-cn-XiaoruiNeural（女）</p></li>
<li><p>晓双: zh-cn-XiaoshuangNeural（女）</p></li>
<li><p>晓晓: zh-cn-XiaoxiaoNeural（女）</p></li>
<li><p>晓萱: zh-cn-XiaoxuanNeural（女）</p></li>
<li><p>晓颜: zh-cn-XiaoyanNeural（女）</p></li>
<li><p>晓伊: zh-cn-XiaoyiNeural（女）</p></li>
<li><p>晓悠: zh-cn-XiaoyouNeural（女）</p></li>
<li><p>晓甄: zh-cn-XiaozhenNeural（女）</p></li>
<li><p>云枫: zh-cn-YunfengNeural（男）</p></li>
<li><p>云皓: zh-cn-YunhaoNeural（男）</p></li>
<li><p>云健: zh-cn-YunjianNeural（男）</p></li>
<li><p>云夏: zh-cn-YunxiaNeural（男）</p></li>
<li><p>云希: zh-cn-YunxiNeural（男）</p></li>
<li><p>云扬: zh-cn-YunyangNeural男）</p></li>
<li><p>云野: zh-cn-YunyeNeural（男）</p></li>
<li><p>云泽: zh-cn-YunzeNeural（男）</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>中文（粤语，简体）:</dt><dd><ul>
<li><p>晓敏: yue-CN-XiaoMinNeural（女）</p></li>
<li><p>云松: yue-CN-YunSongNeural（男）</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>英语（美国）:</dt><dd><ul>
<li><p>AI1: en-US-AIGenerate1Neural（男）</p></li>
<li><p>AI2: en-US-AIGenerate2Neural（女）</p></li>
<li><p>en-US-AmberNeural（女）</p></li>
<li><p>安娜: en-US-AnaNeural（女）</p></li>
<li><p>阿丽亚: en-US-AriaNeural（女）</p></li>
<li><p>阿什莉: en-US-AshleyNeural（女）</p></li>
<li><p>布兰登: en-US-BrandonNeural（男）</p></li>
<li><p>克里斯托弗: en-US-ChristopherNeural（男）</p></li>
<li><p>科拉: en-US-CoraNeural（女）</p></li>
<li><p>戴维斯: en-US-DavisNeural（男）</p></li>
<li><p>伊丽莎白: en-US-ElizabethNeural（女）</p></li>
<li><p>埃里克: en-US-EricNeural（男）</p></li>
<li><p>盖伊: en-US-GuyNeural（男）</p></li>
<li><p>雅各布: en-US-JacobNeural（男）</p></li>
<li><p>简: en-US-JaneNeural（女）</p></li>
<li><p>杰森: en-US-JasonNeural（男）</p></li>
<li><p>珍妮(多种语言): en-US-JennyMultilingualNeural（女）</p></li>
<li><p>珍妮: en-US-JennyNeural（女）</p></li>
<li><p>米歇尔: en-US-MichelleNeural（女）</p></li>
<li><p>莫妮卡: en-US-MonicaNeural（女）</p></li>
<li><p>南茜: en-US-NancyNeural（女）</p></li>
<li><p>罗杰: en-US-RogerNeural（男）</p></li>
<li><p>莎拉: en-US-SaraNeural（女）</p></li>
<li><p>史蒂芬: en-US-SteffanNeural（男）</p></li>
<li><p>托尼: en-US-TonyNeural（男）</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>英语（英国）:</dt><dd><ul>
<li><p>阿比: en-GB-AbbiNeural（女）</p></li>
<li><p>阿尔菲: en-GB-AlfieNeural（男）</p></li>
<li><p>贝拉: en-GB-BellaNeural（女）</p></li>
<li><p>艾略特: en-GB-ElliotNeural（男）</p></li>
<li><p>伊桑: en-GB-EthanNeural（男）</p></li>
<li><p>霍莉: en-GB-HollieNeural（女）</p></li>
<li><p>利比: en-GB-LibbyNeural（女）</p></li>
<li><p>梅西: en-GB-MaisieNeural（女）</p></li>
<li><p>诺亚: en-GB-NoahNeural（男）</p></li>
<li><p>奥利弗: en-GB-OliverNeural（男）</p></li>
<li><p>奥利维亚: en-GB-OliviaNeural（女）</p></li>
<li><p>莱恩: en-GB-RyanNeural（男）</p></li>
<li><p>索尼娅: en-GB-SoniaNeural（女）</p></li>
<li><p>托马斯: en-GB-ThomasNeural（男）</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</div></blockquote>
</section>
</section>
</section>
<section id="windowsdriver-exe">
<h2>关闭 WindowsDriver.exe 驱动程序<a class="headerlink" href="#windowsdriver-exe" title="此标题的永久链接">#</a></h2>
<section id="windowsdriver-exe-closedriver">
<h3>关闭WindowsDriver_exe驱动程序 <code class="docutils literal notranslate"><span class="pre">closeDriver()</span></code><a class="headerlink" href="#windowsdriver-exe-closedriver" title="此标题的永久链接">#</a></h3>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-79-79-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-79-79-0" name="79-0" role="tab" tabindex="0">JavaScript</button></div><div aria-labelledby="tab-79-79-0" class="sphinx-tabs-panel" id="panel-79-79-0" name="79-0" role="tabpanel" tabindex="0"><dl class="js function">
<dt class="sig sig-object js" id="WindowsBot.closeDriver">
<span class="sig-prename descclassname"><span class="n"><span class="pre">WindowsBot</span></span><span class="p"><span class="pre">.</span></span></span><span class="sig-name descname"><span class="n"><span class="pre">closeDriver</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#WindowsBot.closeDriver" title="永久链接至目标">#</a></dt>
<dd><p>关闭WindowsDriver.exe驱动程序</p>
<dl class="field-list simple">
<dt class="field-odd">返回<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>Promise.&lt;void&gt;</strong> –</p>
</dd>
</dl>
</dd></dl>

</div></div>
</section>
</section>
</section>


                </article>
              
              
              
                <footer class="bd-footer-article">
                  <!-- Previous / next buttons -->
<div class="prev-next-area">
    <a class="left-prev"
       href="../web_bot/index.html"
       title="previous page">
      <i class="fa-solid fa-angle-left"></i>
      <div class="prev-next-info">
        <p class="prev-next-subtitle">上一页</p>
        <p class="prev-next-title">WebBot</p>
      </div>
    </a>
    <a class="right-next"
       href="../ui/index.html"
       title="next page">
      <div class="prev-next-info">
        <p class="prev-next-subtitle">下一页</p>
        <p class="prev-next-title">界面开发</p>
      </div>
      <i class="fa-solid fa-angle-right"></i>
    </a>
</div>
                </footer>
              
            </div>
            
            
              
                <div class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">

  <div class="sidebar-secondary-item">
  <div class="page-toc tocsection onthispage">
    <i class="fa-solid fa-list"></i> On this page
  </div>
  <nav class="bd-toc-nav page-toc">
    <ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id1">主函数示例</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id2">等待超时</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sleep">显式等待 <code class="docutils literal notranslate"><span class="pre">sleep()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.sleep"><code class="docutils literal notranslate"><span class="pre">WindowsBot.sleep()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setimplicittimeout">隐式等待 <code class="docutils literal notranslate"><span class="pre">setImplicitTimeout()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.setImplicitTimeout"><code class="docutils literal notranslate"><span class="pre">WindowsBot.setImplicitTimeout()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.todo"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id3">查找句柄</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#findwindow">查找窗口句柄 <code class="docutils literal notranslate"><span class="pre">findWindow()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.findWindow"><code class="docutils literal notranslate"><span class="pre">WindowsBot.findWindow()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.find_window"><code class="docutils literal notranslate"><span class="pre">WinBotMain.find_window()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#findwindows">查找窗口句柄数组 <code class="docutils literal notranslate"><span class="pre">findWindows()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.findWindows"><code class="docutils literal notranslate"><span class="pre">WindowsBot.findWindows()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.find_windows"><code class="docutils literal notranslate"><span class="pre">WinBotMain.find_windows()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#findsubwindow">查找子窗口句柄 <code class="docutils literal notranslate"><span class="pre">findSubWindow()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.findSubWindow"><code class="docutils literal notranslate"><span class="pre">WindowsBot.findSubWindow()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.find_sub_window"><code class="docutils literal notranslate"><span class="pre">WinBotMain.find_sub_window()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#findparentwindow">查找父窗口句柄 <code class="docutils literal notranslate"><span class="pre">findParentWindow()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.findParentWindow"><code class="docutils literal notranslate"><span class="pre">WindowsBot.findParentWindow()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.find_parent_window"><code class="docutils literal notranslate"><span class="pre">WinBotMain.find_parent_window()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#finddesktopwindow">查找桌面窗口句柄 <code class="docutils literal notranslate"><span class="pre">findDesktopWindow()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.findDesktopWindow"><code class="docutils literal notranslate"><span class="pre">WindowsBot.findDesktopWindow()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id0"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id4">获取窗口名称</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getwindowname">获取窗口名称 <code class="docutils literal notranslate"><span class="pre">getWindowName()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getWindowName"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getWindowName()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.get_window_name"><code class="docutils literal notranslate"><span class="pre">WinBotMain.get_window_name()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id5">窗口操作</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#showwindow">显示/隐藏窗口 <code class="docutils literal notranslate"><span class="pre">showWindow()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.showWindow"><code class="docutils literal notranslate"><span class="pre">WindowsBot.showWindow()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.show_window"><code class="docutils literal notranslate"><span class="pre">WinBotMain.show_window()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setwindowtop">设置窗口到最顶层 <code class="docutils literal notranslate"><span class="pre">setWindowTop()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.setWindowTop"><code class="docutils literal notranslate"><span class="pre">WindowsBot.setWindowTop()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.set_window_top"><code class="docutils literal notranslate"><span class="pre">WinBotMain.set_window_top()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getwindowpos">获取窗口位置 <code class="docutils literal notranslate"><span class="pre">getWindowPos()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getWindowPos"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getWindowPos()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id6"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setwindowpos">设置窗口位置 <code class="docutils literal notranslate"><span class="pre">setWindowPos()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.setWindowPos"><code class="docutils literal notranslate"><span class="pre">WindowsBot.setWindowPos()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id7"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id8">鼠标键盘</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#movemouse">移动鼠标 <code class="docutils literal notranslate"><span class="pre">moveMouse()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.moveMouse"><code class="docutils literal notranslate"><span class="pre">WindowsBot.moveMouse()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.move_mouse"><code class="docutils literal notranslate"><span class="pre">WinBotMain.move_mouse()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#movemouserelative">移动鼠标(相对坐标) <code class="docutils literal notranslate"><span class="pre">moveMouseRelative()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.moveMouseRelative"><code class="docutils literal notranslate"><span class="pre">WindowsBot.moveMouseRelative()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id9"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#rollmouse">滚动鼠标 <code class="docutils literal notranslate"><span class="pre">rollMouse()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.rollMouse"><code class="docutils literal notranslate"><span class="pre">WindowsBot.rollMouse()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.scroll_mouse"><code class="docutils literal notranslate"><span class="pre">WinBotMain.scroll_mouse()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#clickmouse">鼠标点击 <code class="docutils literal notranslate"><span class="pre">clickMouse()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.clickMouse"><code class="docutils literal notranslate"><span class="pre">WindowsBot.clickMouse()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.click_mouse"><code class="docutils literal notranslate"><span class="pre">WinBotMain.click_mouse()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sendkeys">输入文本 <code class="docutils literal notranslate"><span class="pre">sendKeys()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.sendKeys"><code class="docutils literal notranslate"><span class="pre">WindowsBot.sendKeys()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.send_keys"><code class="docutils literal notranslate"><span class="pre">WinBotMain.send_keys()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#sendkeysbyhwnd">后台输入文本 <code class="docutils literal notranslate"><span class="pre">sendKeysByHwnd()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.sendKeysByHwnd"><code class="docutils literal notranslate"><span class="pre">WindowsBot.sendKeysByHwnd()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.send_keys_by_hwnd"><code class="docutils literal notranslate"><span class="pre">WinBotMain.send_keys_by_hwnd()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#vk-sendvk">输入虚拟键值(VK) <code class="docutils literal notranslate"><span class="pre">sendVk()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.sendVk"><code class="docutils literal notranslate"><span class="pre">WindowsBot.sendVk()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.send_vk"><code class="docutils literal notranslate"><span class="pre">WinBotMain.send_vk()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#vk-sendvkbyhwnd">后台输入虚拟键值(VK) <code class="docutils literal notranslate"><span class="pre">sendVkByHwnd()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.sendVkByHwnd"><code class="docutils literal notranslate"><span class="pre">WindowsBot.sendVkByHwnd()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.send_vk_by_hwnd"><code class="docutils literal notranslate"><span class="pre">WinBotMain.send_vk_by_hwnd()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id10">图色操作</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#savescreenshot">截图保存 <code class="docutils literal notranslate"><span class="pre">saveScreenshot()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.saveScreenshot"><code class="docutils literal notranslate"><span class="pre">WindowsBot.saveScreenshot()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.save_screenshot"><code class="docutils literal notranslate"><span class="pre">WinBotMain.save_screenshot()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getcolor">获取指定坐标点的色值 <code class="docutils literal notranslate"><span class="pre">getColor()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getColor"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getColor()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.get_color"><code class="docutils literal notranslate"><span class="pre">WinBotMain.get_color()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#findimage">找图 <code class="docutils literal notranslate"><span class="pre">findImage()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.findImage"><code class="docutils literal notranslate"><span class="pre">WindowsBot.findImage()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.find_images"><code class="docutils literal notranslate"><span class="pre">WinBotMain.find_images()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#findanimation">找动态图 <code class="docutils literal notranslate"><span class="pre">findAnimation()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.findAnimation"><code class="docutils literal notranslate"><span class="pre">WindowsBot.findAnimation()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.find_dynamic_image"><code class="docutils literal notranslate"><span class="pre">WinBotMain.find_dynamic_image()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#findcolor">查找指定色值的坐标点 <code class="docutils literal notranslate"><span class="pre">findColor()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.findColor"><code class="docutils literal notranslate"><span class="pre">WindowsBot.findColor()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.find_color"><code class="docutils literal notranslate"><span class="pre">WinBotMain.find_color()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#comparecolor">比较指定坐标点的颜色值 <code class="docutils literal notranslate"><span class="pre">compareColor()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.compareColor"><code class="docutils literal notranslate"><span class="pre">WindowsBot.compareColor()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id11"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#ocr">OCR系统</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#findwords">找字 <code class="docutils literal notranslate"><span class="pre">findWords()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.findWords"><code class="docutils literal notranslate"><span class="pre">WindowsBot.findWords()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.find_text"><code class="docutils literal notranslate"><span class="pre">WinBotMain.find_text()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getwords">获取屏幕文字 <code class="docutils literal notranslate"><span class="pre">getWords()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getWords"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getWords()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.get_text"><code class="docutils literal notranslate"><span class="pre">WinBotMain.get_text()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id12">元素操作</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getelementname">获取元素名称 <code class="docutils literal notranslate"><span class="pre">getElementName()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getElementName"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getElementName()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.get_element_name"><code class="docutils literal notranslate"><span class="pre">WinBotMain.get_element_name()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getelementvalue">获取元素文本 <code class="docutils literal notranslate"><span class="pre">getElementValue()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getElementValue"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getElementValue()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.get_element_value"><code class="docutils literal notranslate"><span class="pre">WinBotMain.get_element_value()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getelementrect">获取元素矩形大小 <code class="docutils literal notranslate"><span class="pre">getElementRect()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getElementRect"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getElementRect()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.get_element_rect"><code class="docutils literal notranslate"><span class="pre">WinBotMain.get_element_rect()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getelementwindow">获取元素窗口句柄 <code class="docutils literal notranslate"><span class="pre">getElementWindow()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getElementWindow"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getElementWindow()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.get_element_window"><code class="docutils literal notranslate"><span class="pre">WinBotMain.get_element_window()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#clickelement">点击元素 ``clickElement()</a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.clickElement"><code class="docutils literal notranslate"><span class="pre">WindowsBot.clickElement()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.click_element"><code class="docutils literal notranslate"><span class="pre">WinBotMain.click_element()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#invokeelement">执行元素默认操作(一般是点击操作) <code class="docutils literal notranslate"><span class="pre">invokeElement()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.invokeElement"><code class="docutils literal notranslate"><span class="pre">WindowsBot.invokeElement()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id15"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setelementfocus">设置元素作为焦点 <code class="docutils literal notranslate"><span class="pre">setElementFocus()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.setElementFocus"><code class="docutils literal notranslate"><span class="pre">WindowsBot.setElementFocus()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.set_element_focus"><code class="docutils literal notranslate"><span class="pre">WinBotMain.set_element_focus()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setelementvalue">设置元素文本 <code class="docutils literal notranslate"><span class="pre">setElementValue()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.setElementValue"><code class="docutils literal notranslate"><span class="pre">WindowsBot.setElementValue()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.set_element_value"><code class="docutils literal notranslate"><span class="pre">WinBotMain.set_element_value()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setelementscroll">滚动元素 <code class="docutils literal notranslate"><span class="pre">setElementScroll()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.setElementScroll"><code class="docutils literal notranslate"><span class="pre">WindowsBot.setElementScroll()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.scroll_element"><code class="docutils literal notranslate"><span class="pre">WinBotMain.scroll_element()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#isselected">单/复选框是否选中 <code class="docutils literal notranslate"><span class="pre">isSelected()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.isSelected"><code class="docutils literal notranslate"><span class="pre">WindowsBot.isSelected()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id16"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#closewindow">关闭窗口 <code class="docutils literal notranslate"><span class="pre">closeWindow()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.closeWindow"><code class="docutils literal notranslate"><span class="pre">WindowsBot.closeWindow()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.close_window"><code class="docutils literal notranslate"><span class="pre">WinBotMain.close_window()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setwindowstate">设置窗口状态 <code class="docutils literal notranslate"><span class="pre">setWindowState()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.setWindowState"><code class="docutils literal notranslate"><span class="pre">WindowsBot.setWindowState()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.set_element_state"><code class="docutils literal notranslate"><span class="pre">WinBotMain.set_element_state()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id17">系统剪切板</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#setclipboardtext">设置剪切板内容 <code class="docutils literal notranslate"><span class="pre">setClipboardText()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.setClipboardText"><code class="docutils literal notranslate"><span class="pre">WindowsBot.setClipboardText()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.set_clipboard_text"><code class="docutils literal notranslate"><span class="pre">WinBotMain.set_clipboard_text()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getclipboardtext">获取剪切板内容 <code class="docutils literal notranslate"><span class="pre">getClipboardText()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getClipboardText"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getClipboardText()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.get_clipboard_text"><code class="docutils literal notranslate"><span class="pre">WinBotMain.get_clipboard_text()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id18">启动进程</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#startprocess">启动进程 <code class="docutils literal notranslate"><span class="pre">startProcess()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.startProcess"><code class="docutils literal notranslate"><span class="pre">WindowsBot.startProcess()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.start_process"><code class="docutils literal notranslate"><span class="pre">WinBotMain.start_process()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#cmd">执行cmd命令</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#cmd-executecommand">执行cmd命令 <code class="docutils literal notranslate"><span class="pre">executeCommand()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.executeCommand"><code class="docutils literal notranslate"><span class="pre">WindowsBot.executeCommand()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id19"><code class="docutils literal notranslate"><span class="pre">WinBotMain.start_process()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#url">指定url下载文件</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#url-downloadfile">指定url下载文件 <code class="docutils literal notranslate"><span class="pre">downloadFile()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.downloadFile"><code class="docutils literal notranslate"><span class="pre">WindowsBot.downloadFile()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#AiBot.WinBotMain.download_file"><code class="docutils literal notranslate"><span class="pre">WinBotMain.download_file()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#excel">Excel文档</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#excel-openexcel">打开excel文档 <code class="docutils literal notranslate"><span class="pre">openExcel()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.openExcel"><code class="docutils literal notranslate"><span class="pre">WindowsBot.openExcel()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#excel-openexcelsheet">打开excel表格 <code class="docutils literal notranslate"><span class="pre">openExcelSheet()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.openExcelSheet"><code class="docutils literal notranslate"><span class="pre">WindowsBot.openExcelSheet()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#excel-saveexcel">保存/关闭excel文档 <code class="docutils literal notranslate"><span class="pre">saveExcel()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.saveExcel"><code class="docutils literal notranslate"><span class="pre">WindowsBot.saveExcel()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#excel-writeexcelnum">写入数字到excel表格 <code class="docutils literal notranslate"><span class="pre">writeExcelNum()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.writeExcelNum"><code class="docutils literal notranslate"><span class="pre">WindowsBot.writeExcelNum()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#excel-writeexcelstr">写入字串到excel表格 <code class="docutils literal notranslate"><span class="pre">writeExcelStr()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.writeExcelStr"><code class="docutils literal notranslate"><span class="pre">WindowsBot.writeExcelStr()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#excel-readexcelnum">读取excel表格数字 <code class="docutils literal notranslate"><span class="pre">readExcelNum()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.readExcelNum"><code class="docutils literal notranslate"><span class="pre">WindowsBot.readExcelNum()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#excel-readexcelstr">读取excel表格字串 <code class="docutils literal notranslate"><span class="pre">readExcelStr()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.readExcelStr"><code class="docutils literal notranslate"><span class="pre">WindowsBot.readExcelStr()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#excel-removeexcelrow">删除excel表格行 <code class="docutils literal notranslate"><span class="pre">removeExcelRow()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.removeExcelRow"><code class="docutils literal notranslate"><span class="pre">WindowsBot.removeExcelRow()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#excel-removeexcelcol">删除excel表格列 <code class="docutils literal notranslate"><span class="pre">removeExcelCol()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.removeExcelCol"><code class="docutils literal notranslate"><span class="pre">WindowsBot.removeExcelCol()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id20">验证码系统</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#getcaptcha">识别验证码 <code class="docutils literal notranslate"><span class="pre">getCaptcha()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.getCaptcha"><code class="docutils literal notranslate"><span class="pre">WindowsBot.getCaptcha()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id21"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#errorcaptcha">识别报错返分 <code class="docutils literal notranslate"><span class="pre">errorCaptcha()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.errorCaptcha"><code class="docutils literal notranslate"><span class="pre">WindowsBot.errorCaptcha()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id22"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#scorecaptcha">查询验证码剩余题分 <code class="docutils literal notranslate"><span class="pre">scoreCaptcha()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.scoreCaptcha"><code class="docutils literal notranslate"><span class="pre">WindowsBot.scoreCaptcha()</span></code></a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id23"><code class="docutils literal notranslate"><span class="pre">WinBotMain.todo()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#nlp">自然语言处理(NLP)</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#nlp-initnlp">初始化NLP <code class="docutils literal notranslate"><span class="pre">initNLP()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.initNLP"><code class="docutils literal notranslate"><span class="pre">WindowsBot.initNLP()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#chatgpt">chatGPT的使用</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#chatgpt-chatgpt">使用chatgpt <code class="docutils literal notranslate"><span class="pre">chatgpt()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.chatgpt"><code class="docutils literal notranslate"><span class="pre">WindowsBot.chatgpt()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#chatgpt-chatgptedit">使用chatgpt编辑模式 <code class="docutils literal notranslate"><span class="pre">chatgptEdit()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.chatgptEdit"><code class="docutils literal notranslate"><span class="pre">WindowsBot.chatgptEdit()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#id24">训练模型</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#createfinetune">创建微调模型 <code class="docutils literal notranslate"><span class="pre">createFineTune()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.createFineTune"><code class="docutils literal notranslate"><span class="pre">WindowsBot.createFineTune()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#listfinetunes">列出所有微调信息 <code class="docutils literal notranslate"><span class="pre">listFineTunes()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.listFineTunes"><code class="docutils literal notranslate"><span class="pre">WindowsBot.listFineTunes()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#cancelfinetune">取消正在微调的作业 <code class="docutils literal notranslate"><span class="pre">cancelFineTune()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.cancelFineTune"><code class="docutils literal notranslate"><span class="pre">WindowsBot.cancelFineTune()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#deletefinetunemodel">删除微调模型 <code class="docutils literal notranslate"><span class="pre">deleteFineTuneModel()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.deleteFineTuneModel"><code class="docutils literal notranslate"><span class="pre">WindowsBot.deleteFineTuneModel()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#id25">训练数据文件</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#uploadtrainfile">上传训练文件到服务器 <code class="docutils literal notranslate"><span class="pre">uploadTrainFile()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.uploadTrainFile"><code class="docutils literal notranslate"><span class="pre">WindowsBot.uploadTrainFile()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#listtrainfile">列出单个训练文件信息 <code class="docutils literal notranslate"><span class="pre">listTrainFile()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.listTrainFile"><code class="docutils literal notranslate"><span class="pre">WindowsBot.listTrainFile()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#listtrainfiles">列出所有训练文件信息 <code class="docutils literal notranslate"><span class="pre">listTrainFiles()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.listTrainFiles"><code class="docutils literal notranslate"><span class="pre">WindowsBot.listTrainFiles()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#downloadtrainfile">下载训练文件内容 <code class="docutils literal notranslate"><span class="pre">downloadTrainFile()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.downloadTrainFile"><code class="docutils literal notranslate"><span class="pre">WindowsBot.downloadTrainFile()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#deletetrainfile">删除训练文件 <code class="docutils literal notranslate"><span class="pre">deleteTrainFile()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.deleteTrainFile"><code class="docutils literal notranslate"><span class="pre">WindowsBot.deleteTrainFile()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id26">语音合成/识别服务</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#initspeechservice">初始化语音服务 <code class="docutils literal notranslate"><span class="pre">initSpeechService()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.initSpeechService"><code class="docutils literal notranslate"><span class="pre">WindowsBot.initSpeechService()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#id27">语音识别</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#audiofiletotext">音频文件转文本 <code class="docutils literal notranslate"><span class="pre">audioFileToText()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.audioFileToText"><code class="docutils literal notranslate"><span class="pre">WindowsBot.audioFileToText()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#microphonetotext">麦克风输入音频换文本 <code class="docutils literal notranslate"><span class="pre">microphoneToText()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.microphoneToText"><code class="docutils literal notranslate"><span class="pre">WindowsBot.microphoneToText()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#id28">合成语音</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#texttobullhorn">文本合成语音输出到扬声器播放 <code class="docutils literal notranslate"><span class="pre">textToBullhorn()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.textToBullhorn"><code class="docutils literal notranslate"><span class="pre">WindowsBot.textToBullhorn()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#texttoaudiofile">文本合成语音保存到本地音频文件 <code class="docutils literal notranslate"><span class="pre">textToAudioFile()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.textToAudioFile"><code class="docutils literal notranslate"><span class="pre">WindowsBot.textToAudioFile()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#ssml">SSML格式合成语音</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#ssml-ssmltobullhorn">SSML文本格式合成音频到扬声器 <code class="docutils literal notranslate"><span class="pre">SSMLToBullhorn()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.SSMLToBullhorn"><code class="docutils literal notranslate"><span class="pre">WindowsBot.SSMLToBullhorn()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#ssml-ssmltofile">SSML文本格式合成音频到扬声器 <code class="docutils literal notranslate"><span class="pre">SSMLToFile()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.SSMLToFile"><code class="docutils literal notranslate"><span class="pre">WindowsBot.SSMLToFile()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#id29">语音翻译</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#microphonetranslationtext">麦克风音频翻译成目标语言文本 <code class="docutils literal notranslate"><span class="pre">microphoneTranslationText()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.microphoneTranslationText"><code class="docutils literal notranslate"><span class="pre">WindowsBot.microphoneTranslationText()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#audiofiletranslationtext">音频文件翻译成目标语言文本 <code class="docutils literal notranslate"><span class="pre">audioFileTranslationText()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.audioFileTranslationText"><code class="docutils literal notranslate"><span class="pre">WindowsBot.audioFileTranslationText()</span></code></a></li>
</ul>
</li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#id30">语言和发音人</a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id31">语言</a></li>
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#id32">发音人</a></li>
</ul>
</li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#windowsdriver-exe">关闭 WindowsDriver.exe 驱动程序</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#windowsdriver-exe-closedriver">关闭WindowsDriver_exe驱动程序 <code class="docutils literal notranslate"><span class="pre">closeDriver()</span></code></a><ul class="nav section-nav flex-column">
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#WindowsBot.closeDriver"><code class="docutils literal notranslate"><span class="pre">WindowsBot.closeDriver()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
  </nav></div>

</div></div>
              
            
          </div>
          <footer class="bd-footer-content">
            <div class="bd-footer-content__inner"></div>
          </footer>
        
      </main>
    </div>
  </div>
  
  <!-- Scripts loaded after <body> so the DOM is not blocked -->
  <script src="../../_static/scripts/bootstrap.js?digest=12da95d707ffb74b382d"></script>
<script src="../../_static/scripts/pydata-sphinx-theme.js?digest=12da95d707ffb74b382d"></script>

  <footer class="bd-footer">
<div class="bd-footer__inner bd-page-width">
  
    <div class="footer-items__start">
      
        <div class="footer-item">
  <p class="copyright">
    
      © Copyright 2023, Aibote.
      <br/>
    
  </p>
</div>
      
        <div class="footer-item">
  <p class="sphinx-version">
    Created using <a href="https://sphinx-doc.org/">Sphinx</a> 5.3.0.
    <br/>
  </p>
</div>
      
    </div>
  
  
    <div class="footer-items__end">
      
        <div class="footer-item"><p class="theme-version">
  Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.13.1.
</p></div>
      
    </div>
  
</div>

  </footer>
  </body>
</html>